Click here to Skip to main content
16,020,811 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am not able to hide header and footer while printing invoice.
i dont want to show url and page number in print

below is my code

XML
Dim strScript As String = "<script language=JavaScript>"
            strScript += "window.print();"
Posted

1 solution

Refer - Re: How to remove path and date in printing???[^].
Quote:
Please explain your requirements a little clearly. From what I gather, your getting stuff like "http://www.mysite.com/somepage.aspx", "page 1/1" and the date int the page header/footer after printing. Is this right? If so, [as i said before], it is NOT POSSIBLE to control the output (or remove) the header/footer from asp.net. It is entirely dependant on the browser's page layout settings. You CAN NOT change that. If you use window.print(), those texts will be in the print unless the user changes their browser's settings. If you don't want them, you have three options:

1. Request user to change their browser settings (impractical)

2. Use a reporting plugin / printing plugin.

3. Give them output in pdf format using something like itextsharp.

I hope you understand.
 
Share this answer
 
Comments
Pro86 12-Aug-13 10:23am    
actually when i am printing through my vb.net code. In my print documnet at bottom page web site url is displyed which i dont want to show on printed page
It can't be done as I referred in my answer.

So, if you want to do that, then go for itextsharp.
Sergey Alexandrovich Kryukov 12-Aug-13 17:16pm    
I think the only practical solution is #3, up-voted with 4.

By the way, the lack of any sound control (or no control at all) over those headers/footers in print is most Web browsers is considerable defect. I cannot explain such sloppiness, despite the intense browser wars...

It would be really good to have, not just to make your #1 item practical. :-)
—SA
Thanks a lot Sergey Alexandrovich Kryukov... :)

Yes you are right. The browsers should provide control over it. This is the most common requirement these days to remove headers and footers.

Regards,
Tadit
Sergey Alexandrovich Kryukov 13-Aug-13 2:09am    
Yes, or, just the opposite, to add them. Or customize... Still they don't; some do one thing but not another.., that is pretty irritating...
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900