隐藏页眉和页脚 [英] Hide Header and Footer
本文介绍了隐藏页眉和页脚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好
i打印发票时无法隐藏页眉和页脚。
i不想要在网页上显示网址和页码
以下是我的代码
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
Dim strScript As String = "<script language="JavaScript">"
strScript += "window.print();"
推荐答案
您无法使用javascript window.print()函数隐藏它...
使用任何报告工具,如水晶报告和打印...
它将使用ActiveX以专业的方式打印...
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...
hi ..
i在我的应用程序中添加了以下代码,它可以工作对我而言。
但它只适用于Internet Explorer。
hi..
i have added following code in my application and it works for me.
But it will works with internet explorer only
<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>
然后在代码中调用ResetHeader函数
then Call ResetHeader Function in your code
这篇关于隐藏页眉和页脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文