整个页面由三个frame组成,想“打印预览”主框架frmMain中的页面内容?

解决方案 »

  1.   

    <td><OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0>
    </OBJECT>
    <input type=button value=打印 onclick=document.all.WebBrowser.ExecWB(6,6)> 
    <input type=button value=页面设置 onclick=document.all.WebBrowser.ExecWB(8,1)>
    <input type=button value=打印预览 onclick=document.all.WebBrowser.ExecWB(7,1)>onclick="top.focus();top.print();"
      

  2.   

    请参考http://www.fcsoft.com.cn/webprint/index.html有问题请加msn:[email protected]
      

  3.   

    <OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0" id="WebBrowser" width="0"></OBJECT> 
    <input name="Button" onClick="document.all.hiddenframe.ExecWB(7,1);" type="button" value="打印预览">
    <iframe frameborder="0" height="10%" width="100%" name="hiddenframe" src="test.htm"></iframe> 
     <body> 
    <input onclick='prn()' type=button value=print_Iframe> <br> 
    <iframe id=mxh src="d:\hhh.htm"> </iframe> 
    <script> 
    function prn() 

    var win=window.open("about:blank") 
    win.moveTo(1200,1200) 
    win.location=document.all.mxh.src 
    win.print() 

    </script>  
      

  4.   

    使用<style media="print">来设置打印的样式,让其它的框架在media="print"中的样式为不可见,让目标框架为可见,就可以只打印目标框架内容了。另外,三年的问题,还没解决,而且还能想起来问,真是奇迹。