如题

解决方案 »

  1.   

    例如:我想用程序控制打印下面的页面
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>打印</title>
    </head>
    <body>
    打印
    </body>
    </html>我要打这个页面,但不能按IE上的按钮,
    请问我用JSP怎么才能打印这个页面??
      

  2.   

    <%@ page contentType="text/html; charset=GB2312" %>
    <html>
    <head>
    <title></title>
    </head>
    <body>
    <form name="f1">
    <input type=button name="print" value="打印" onClick="window.print()">
    </form>
    </body>
    </html>
      

  3.   

    请问怎样用JSP直接调用“window.print()”
      

  4.   

    这个和JSP不搭界的,就是javascript,楼上的说得很清楚了
      

  5.   

    我给你一个js脚本吧,然后在jsp中导入这个脚本就行了.
     //print.js
    with (document)
    {//输出样式表表及IE打印控件
    write ("<style type=\"text/css\" media=\"print\">");
    write ("  .noprint{display:none;}");
        write("  .border:1px");
    write ("</style>");
    write ("<OBJECT  classid='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2' height=0 id=WB width=0 ></object>");
    }
    function doPrintSetup()
    {//打印设置
    WB.ExecWB(8,1);
    }
    function doPrintPreview()
    {//打印预览
    WB.ExecWB(7,1);
    }
    function doPrint()
    {
    //WB.ExecWB(6,1);
    window.print();
    }
    function showPrintBar()
    {
    with (document)
    {
    write ("<div align=\"center\" class=\"noprint\">");
    //write ("  <input type=\"button\" name=\"doBack\" value=\"关闭\" onClick=\"window.close()\">");
    write ("  <input type=\"button\" name=\"doPrintSetup\" onClick=\"WB.ExecWB(8,1)\" value=\"页面设置\">");
    write ("  <input type=\"button\" name=\"doPrintPreview\" onClick=\"WB.ExecWB(7,1)\" value=\"打印预览\">");
    write ("  <input type=\"button\" name=\"doPrint\" value=\"打印\" onClick=\"doPrint()\">");
    write ("</div>")
    }
    }
      

  6.   

    请问 xjbs(大鱼) 具体怎么做??
    最好能详细说明一下,偶比较笨
      

  7.   

    你可以这样:
    <%@ page contentType="text/html;charset=gb2312" %><html>
    <head>
    <title>打印</title>
    </head>
    <body onload="javascript:window.print();">
    打印
    </body>
    </html>
    这样一运行页面就开始打印了!
      

  8.   

    因为IE没有像word那样的快速打印功能