We have an action bar using the Java applet and wished to hide the bar when printing. Our original solution was to either refresh or re-open the form, setting hide-when formulas to prevent the action bar from displaying. We then either refresh or redirect back to the original URL. The problem here is that each refresh or redirection is another hit on the server. To get around this, we use the following code:
document.all.tags("Applet")(0).style.display="none";
window.print();
document.all.tags("Applet")(0).style.display="";
For IE 5.5, there is a bug in the browser that prevents the window.print from functioning. We have a work around for this that involves using the JS 'setTimeout' function:
setTimeout('document.all.tags("Applet")(0).style.display="none";', 200);
setTimeout('window.print();', 200);
setTimeout('document.all.tags("Applet")(0).style.display="";', 200);
This was first published in April 2002