I am using the following code to print a page in my application ...
<html><body onload=""window.print();"">" sHtmlBody = sHtmlBody & "<body>"
window.print() working fine. I know, as soon as printing appears, I can manually go to settings and delete headers and footers. In IE, I know that I need to go to print preview, and then delete print headers. A.
However, is there any line of code that does this automatically, so users of the application do not need to do this?
EDIT:
sHtmlBody = "<style type='text/css'>" sHtmlBody = sHtmlBody & " @media print{" sHtmlBody = sHtmlBody & " body{ background-color:#FFFFFF; background-image:none; color:#000000 }" sHtmlBody = sHtmlBody & " #ad{ display:none;}" sHtmlBody = sHtmlBody & " #leftbar{ display:none;}" sHtmlBody = sHtmlBody & " #contentarea{ width:100%;}" sHtmlBody = sHtmlBody & " }" sHtmlBody = sHtmlBody & " </style>" sHtmlBody = sHtmlBody & "<html><body onload=""window.print();"">" sHtmlBody = sHtmlBody & "<body>"
source share