WEB页的局部打印

关于WEB页的局部打印问题:
JScript code
---------------------------------------- <script language="javascript"> <!-- function PrintNote() { var PrintWin=window.open('about:blank','Print'); PrintWin.document.write('<object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>' + document.all("PrintContent").innerHTML); PrintWin.document.all.WebBrowser.ExecWB(7,1); PrintWin.close(); } --> </script> -------------------------------------------- 内容用<div>装起来,并把DIV设置ID <div id="PrintContent" align="center"> your GridView </div> ------------------------------------ <input onclick="javascript:PrintNote();" type="button" value="打印" id="Button2" onserverclick="Button2_ServerClick" runat="server"/>

把gridvie控件放入DIV里就可以实现打印了。
posted @ 2007-11-13 18:00  Nina  阅读(394)  评论(0编辑  收藏  举报