Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello


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
Comments
kishore sharma 20-Aug-13 4:11am    
the header and footer are the browser setting so we cannot change it using code

You cannot hide it using javascript window.print() function...
Use any reporting tools like crystal reports, and Print...
It will use ActiveX to print in a professional manner...
 
Share this answer
 
hi..

i have added following code in my application and it works for me.
But it will works with internet explorer only

XML
<script type="text/vbscript" language="vbscript">
      Dim WSHShell
      Set WSHShell = CreateObject("WScript.Shell")
      WSHShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\PageSetup\header", ""
      WSHShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\PageSetup\footer", ""

       Sub ResetHeader()
           Dim WSHShell
           Set WSHShell = CreateObject("WScript.Shell")
           WSHShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\PageSetup\header", "&w&bPage &p of &P"
           WSHShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\PageSetup\footer", "&u&b&d"

       End Sub

</script>




then Call ResetHeader Function in your code
 
Share this answer
 

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