When I use File > Print Preview, it always displays the correct preview; that is, the outermost window which contains the print div. Printing from the Print Preview works as it should. However, when I use File > Print, it seems to print whatever window has focus, not the entire page (outermost window). Therefore my print div doesn't get printed and all I get is a printout of whatever is currently onscreen. Why doesn't the print out from File > Print match what is shown in the print preview?
My temporary solution is to focus on the outermost frame when the users mouses out of the nested window (ie, when they mouse up to the file menu)
window.onmouseout = parent.parent.window.focus();
and focus on the outermost frame when the user clicks the print button that is within the nested frame. I would really rather not do this focusing, especially on mouseout, because it seems to cause some issues when the user pulls up another application.
I have also tried using the onbeforeprint event to focus. The onbeforeprint was triggered, but I couldn't get the focusing to work correctly.
I haven't been able to find anything regarding these problems online; has anybody had similar problems? I would really appreciate any advice. Thanks!