谁有我也想要一份!谢谢!
[email protected]

解决方案 »

  1.   

    <script language="javascript">
    function printsetup(){
    // 打印页面设置
    wb.execwb(8,1);
    }
    function printpreview(){
    // 打印页面预览
            
    wb.execwb(7,1);
              
            
    } function printit()
    {
    if (confirm('确定打印吗?')) {
    wb.execwb(6,6)
    }
    }
    </script>
    </head>
    <body>
    <OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=0></OBJECT>
    <input type=button name=button_print value="打印" onclick="javascript:printit()">
    <input type=button  name=button_setup value="打印页面设置" onclick="javascript:printsetup();"> 
    <input type=button  name=button_show value="打印预览" onclick="javascript:printpreview();"> 
    <input type=button name=button_fh value="关闭" onclick="javascript:window.close();">------------------------------------------------
    关于这个组件还有其他的用法,列举如下:
    WebBrowser.ExecWB(1,1) 打开
    Web.ExecWB(2,1) 关闭现在所有的IE窗口,并打开一个新窗口
    Web.ExecWB(4,1) 保存网页
    Web.ExecWB(6,1) 打印
    Web.ExecWB(7,1) 打印预览
    Web.ExecWB(8,1) 打印页面设置
    Web.ExecWB(10,1) 查看页面属性
    Web.ExecWB(15,1) 好像是撤销,有待确认
    Web.ExecWB(17,1) 全选
    Web.ExecWB(22,1) 刷新
    Web.ExecWB(45,1) 关闭窗体无提示
      

  2.   

    up!随便给我一份:[email protected]
      

  3.   

    give me,thanks :[email protected]
      

  4.   

    我也想要,也给我发一份吧!!!
    [email protected]
      

  5.   

    谢谢,我也急需
    [email protected]
      

  6.   

    可以给我一份吗?
    [email protected]
    谢谢!......
      

  7.   

    [email protected]
    我也要一份,谢谢
      

  8.   

    [email protected]
    我想要,谢谢!
      

  9.   

    [email protected]
    十分感谢!
      

  10.   

    现在要有没有晚了一点?[email protected],十分感谢!
      

  11.   

    学习学习,指教指教^_^[email protected]
      

  12.   

    谁有我也想要一份!谢谢!
    [email protected]
      

  13.   

    谁有的请也给我一份谢谢!
    [email protected]
      

  14.   

    我有一种,你看看可以吗。先用excel做一个摸版,之后用在这个摸版生成一个网页,把网页改成jsp文件。就可以,对了还的加一个头文件,就可以实现数据到入到这个摸版中,用户就可以利用这个打印了
      

  15.   

    [email protected]
    谢谢,也给我一份
      

  16.   

    我也想要一份,[email protected]
      

  17.   

    强烈关注中  [email protected]
      

  18.   

    <!--统计及格于不及格人数-->
    <%@ page contentType="application/pdf;charset=GB2312"%>
    <%@ page import="java.io.*"%>
    <%@ page import="java.io.FileOutputStream"%>
    <%@ page import="java.io.IOException"%>
    <%@ page import="java.util.*"%>
    <%@ page import="java.text.*"%>
    <%@ page import="java.lang.*"%>
    <%@ page import="java.awt.color.*"%>
    <%@ page import="java.awt.font.*"%>
    <%@ page import="com.lowagie.text.*"%>
    <%@ page import="com.lowagie.text.pdf.*"%>
    <%@ page import="com.lowagie.text.pdf.PdfWriter"%>
    <%@ page import="com.lowagie.text.html.HtmlWriter"%>
    <%
    Calendar cal=Calendar.getInstance();
    Date dt=cal.getTime();
    //System.out.println(dt);
    SimpleDateFormat df=new SimpleDateFormat("yyyyMMdd");
    SimpleDateFormat df1=new SimpleDateFormat("yyyy年MM月dd日");
    //String str=df1.format(dt);
    %>
    <%
    String time=df1.format(dt);
    String pass=request.getParameter("passed");
    String fail=request.getParameter("failed");
    String absent=request.getParameter("absent");
    String total=request.getParameter("total");
    String filename=df.format(dt);
    String aPath = application.getRealPath("/");
    String templateName=aPath + "new/tongji/passorfail.pdf";
    ByteArrayOutputStream ba = new ByteArrayOutputStream();
        try {
          /*打开已经定义好字段以后的pdf模板*/
          
          PdfReader reader = new PdfReader(templateName);
          /*将要生成的目标PDF文件名称*/
          PdfStamper stamp = new PdfStamper(reader,ba);      PdfContentByte under = stamp.getUnderContent(1);      /*使用中文字体*/
          BaseFont bf = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H",BaseFont.NOT_EMBEDDED);
          Font FontChinese = new Font(bf, 12, Font.NORMAL);
          /*取出报表模板中的所有字段*/
          AcroFields form = stamp.getAcroFields();
          form.setField("time",time);
          form.setField("pass",pass);
          form.setField("fail",fail);
          form.setField("que",absent);
          form.setField("total",total);      stamp.setFormFlattening(true);
          /*必须要调用这个,否则文档不会生成的*/
          stamp.close();
     
        }
       catch(DocumentException de)
    {
    de.printStackTrace();
    System.err.println("A Document error:" +de.getMessage());
    } response.setContentType("application/pdf");
    response.setHeader("Content-disposition","attachment; filename="+filename+".pdf" );
    response.setContentLength(ba.size());
    try
    {
    ServletOutputStream outstream = response.getOutputStream();
    ba.writeTo(outstream);
    outstream.flush();
    outstream.close();
    ba.close();
    }
    catch(IOException e)
    {
    e.printStackTrace();
    System.err.println("A Document error:" +e.getMessage());
    }%>
      

  19.   

    压力很大;不是很好做!
    可以用itext做报表打印的
      

  20.   

    学习学习,谢谢指教。也给我2吧:[email protected]
      

  21.   

    在JSP里打印怎么将页眉和页脚去掉?????
      

  22.   

    推荐大家用用用友cell
    很好用的!
      

  23.   

    看样子完了,[email protected],谢谢
      

  24.   

    俺没来晚吧!
    也给俺一份。谢谢
    [email protected]
      

  25.   

    可以用CELL,但是要实现复杂的打印和一些特殊的图表打印,需要使用自己写的浏览器,我有一个这样的浏览器,用DELPHI写的,需要的告诉我!
      

  26.   

    给我一份可以吗?谢谢了
    [email protected]
      

  27.   

    超级想要,一定要给我发一个啊大侠,谢谢了
    [email protected]
      

  28.   

    大哥:
    给我一个:
    lockty
    [email protected]
      

  29.   

    太好了   正是我想要的东西
      给我一个可以吗  谢谢!!!
       [email protected]