改注册表:
<HTML><HEAD>
<script language="JavaScript">
var hkey_root,hkey_path,hkey_key
hkey_root="HKEY_CURRENT_USER"
hkey_path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\"
//设置网页打印的页眉页脚为空
function pagesetup_null()
{
  try{
    var RegWsh = new ActiveXObject("WScript.Shell")
    hkey_key="header"    
    RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"")
    hkey_key="footer"
    RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"")
  }catch(e){}
}
//设置网页打印的页眉页脚为默认值
function pagesetup_default()
{
  try{
    var RegWsh = new ActiveXObject("WScript.Shell")
    hkey_key="header"    
    RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"&w&b页码,&p/&P")
    hkey_key="footer"
    RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"&u&b&d")
  }catch(e){}
}
</script>
</HEAD><BODY><br/><br/><br/><br/><br/><br/><p align=center>
<input type="button" value="清空页码" onclick=pagesetup_null()>
<input type="button" value="恢复页码" onclick=pagesetup_default()><br>
</p></BODY></HTML>

解决方案 »

  1.   

    用JS控制!
    具体请查看 WINDOWS UPDATE 的网站
    他有两个打印 一个是打印当前页就是普通的打印网页
    一个是打印全部 做法是把所有数据取出来放到一个TABLE里 然后把TABLE放到一个隐藏的框架
    可以借鉴他的好多函数的!
      

  2.   

    用这个小控件可以实现
    http://blog.csdn.net/qmei/archive/2005/04/11/342968.aspx
      

  3.   

    用javascript下使用并口控制打印机
    不需要打印机驱动,嘿嘿
    <html>
    <head></head>
    <body>
    <script language=javascript>
    var MyFileObject = new ActiveXObject("Scripting.FileSystemObject");
    var MytextFile = new ActiveXObject("Scripting.FileSystemObject");
    MytextFile = MyFileObject.CreateTextFile("Lpt1");
    var PDStr = "test";
    MytextFile.WriteLine(PDStr);
    MytextFile.Close();
    </script>
    </body>
    </html>
      

  4.   

    <HTML><HEAD><TITLE>#</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=gb2312">
    <LINK href="images/style_index.css" type=text/css rel=stylesheet>
    <style type="text/css">
    <!--
    .tab {
    background-color: #f7f7f7;
    border: 1px solid #999999;
    font-size: 12px;
    color: #333333;
    BORDER-LEFT-COLOR: #000000; 
    BORDER-BOTTOM-COLOR: #000000;  
    BORDER-TOP-COLOR: #000000; 
    BORDER-COLLAPSE: collapse;  
    BORDER-RIGHT-COLOR: #000000
    }
    -->
    </style>
    <SCRIPT language=javascript>
    function printpr()
    {
    document.all("qingkongyema").click();
    document.all("dayinDiv").style.display="none";
    var OLECMDID = 7;
    var PROMPT = 1; 
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
    document.body.insertAdjacentHTML('beforeEnd', WebBrowser); 
    WebBrowser1.ExecWB(OLECMDID, PROMPT);
    WebBrowser1.outerHTML = "";
    document.all("dayinDiv").style.display="";
    }function printTure()
    {
        document.all('qingkongyema').click();
        document.all("dayinDiv").style.display="none";
        window.print();
        document.all("dayinDiv").style.display="";
    }
    function doPage()
    {
        layLoading.style.display = "none";
    }</SCRIPT><script language="VBScript">
    dim hkey_root,hkey_path,hkey_key
    hkey_root="HKEY_CURRENT_USER"
    hkey_path="\Software\Microsoft\Internet Explorer\PageSetup"
    '//设置网页打印的页眉页脚为空
    function pagesetup_null()
    on error resume next
    Set RegWsh = CreateObject("WScript.Shell")
    hkey_key="\header" 
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,""
    hkey_key="\footer"
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,""
    end function
    '//设置网页打印的页眉页脚为默认值
    function pagesetup_default()
    on error resume next
    Set RegWsh = CreateObject("WScript.Shell")
    hkey_key="\header" 
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"&w&b页码,&p/&P"
    hkey_key="\footer"
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"&u&b&d"
    end function
    </script></HEAD>
    <BODY background="images/background_01.gif" leftMargin=0 
    topMargin=0 rightMargin=0 bottomMargin=0 style="BACKGROUND-POSITION: center 50%">这就是你要的东西!!!
    <DIV align="center" id="dayinDiv" name="dayinDiv"><input type="button" class="tab" value="打印" onclick="printTure();">&nbsp;&nbsp;
    <input  type="button" class="tab" value="打印预览" onclick="printpr();">
    <input type="hidden" name="qingkongyema" id="qingkongyema" class="tab" value="清空页码" onclick="pagesetup_null()">&nbsp;&nbsp;
    <input type="hidden" class="tab" value="恢复页码" onclick="pagesetup_default()">
    </DIV>
        </BODY></HTML><script language="javascript">
    var jtqkxx,pxjl,zyxx
    jtqkxx=<%=jtqkxx%>;
    pxjl=<%=pxjl%>;
    zyxx=<%=zyxx%>;if(jtqkxx=="1")
    {
        document.all("jtqkxx").style.display="";
    }if(pxjl=="1")
    {
        document.all("pxjl").style.display="";
    }
    if(zyxx=="1")
    {
        document.all("zyxx").style.display="";
    }
    </script>
      

  5.   

    用上面的改注册表的脚本控制后,打印其他东西的时候是不是会受到影响?比如,在javascript设为不打印页眉页脚,然后在打印word文档时,会不会不能打印页眉页脚
      

  6.   

    如果使用的是控件 enjsky(郭志军) 的方法的话应该改的是IE上的至于word应该不会改变的,你动手试试就知道了
      

  7.   

    我目前想的是动态生成PDF文档,直接对文档进行打印操作.
      

  8.   

    个人感觉,生成WORD用来感觉较好
      

  9.   

    ft,b/s结构,怎么装客户端。可能几百个客户端。而且机器不确定。上网就能用
      

  10.   

    webprint是一个基于表格的页面打印解决方案.先将要打印的数据及样式组织到一个HTML的TABLE元素中, 然后将这个TABLE元素传给webprint,实现分页打印预览,出打印对话框打印和直接打印. 详情参见: www.fcsoft.com.cn
      

  11.   

    去掉打印时的页眉页脚<script language="javascript">  
    var HKEY_Root,HKEY_Path,HKEY_Key;
    HKEY_Root="HKEY_CURRENT_USER";
    HKEY_Path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
    //设置网页打印的页眉页脚为空
    function PageSetup_Null()
    {
     try
     {
             var Wsh=new ActiveXObject("WScript.Shell");
      HKEY_Key="header";
      Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
      HKEY_Key="footer";
      Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
     }
     catch(e){}
    }
    //设置网页打印的页眉页脚为默认值
    function  PageSetup_Default()
    {  
     try
     {
      var Wsh=new ActiveXObject("WScript.Shell");
      HKEY_Key="header";
      Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&w&b页码,&p/&P");
      HKEY_Key="footer";
      Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&u&b&d");
     }
     catch(e){}
    }
    </script>
    <input type="button" value="清空页码" onclick=PageSetup_Null()>
    <input type="button" value="恢复页码" onclick=PageSetup_Default()>