你这应该采用的是网络提供的方法,很难管用哦web打印本来就是个麻烦事,要么请客户自己通过ie设定,要么帮客户把数据转成excel好了

解决方案 »

  1.   

    try:<body style="margin:0">
      

  2.   

    用javascript写,通过修改客户机的注册表达到目的。
    先在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="margin_bottom"//下边距
        RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"0.23346")
        hkey_key="margin_left"//左边距
        RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"0.20669")
        hkey_key="margin_right"//右边距
        RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"0.27333")
        hkey_key="margin_top"//上边距
        RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"0.16667")
      }catch(e){}
    }
    </script>
    然后在Body中写:onload="pagesetup_null()"就可以了,但是如果客户机禁止注册表修改,这种方法就不管用了。
      

  3.   

    <body style="margin:0">