桦山涧

桦山涧
Asp.net ---->知识改变命运!
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

打印问题中用到的一些资料

Posted on 2006-08-22 11:04  桦林  阅读(278)  评论(0编辑  收藏  举报

      (按钮的使用)
       <object   id="WebBrowser"   width=10   height=10   classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>
      <input   type="button"   name="Button"   value="打印预览"   onClick="document.all.WebBrowser.ExecWB(7,1)"> 
      <input   type="button"   name="Button"   value="打印设置"   onClick="document.all.WebBrowser.ExecWB(8,1)">
      <a href=" javascript:window.print()">[打印线路 ] </a>

     <input type="button" name="mPrint" value="打印" onclick="exePrint();"> 
    <input type="button" name="mPreview" value="打印预览" onclick="exePreview();"> 
    <input type="button" name="mSetting" value="打印设置" onclick="exeSetting();"> 
    <object ID="WebBrowser" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-            00C04FD705A2"></object> 
    <script language="javascript">

    function exePrint() 
    { 
    document.all.WebBrowser.ExecWB(6,1); 
    //liu= window.open("b.asp?do=1","_blank","left=2000,top=2000,fullscreen=3");     
    } 
    function exePreview() 
    { 
    //window.open("b.asp?do=2","_blank","left=2000,top=2000,fullscreen=3"); 
    document.all.WebBrowser.ExecWB(7,1);
    }

    function exeSetting() 
    { 
    WebBrowser.ExecWB(8,1); 
    } 
    </script>
    加上一个打印时隐藏按钮的样式:<style> @media print{ INPUT {display:none} } </style>