目录

批量打印

2.7. 批量打印

客户端经常需要对报表进行批量打印,此时可以调用打印applet进行批量打印操作,用法如下:

<% //report的参数格式为:report={无参数报表名}{报表1(参数1=value1;参数2=value2;...)}{报表2(参数1=value1;参数2=value2;...)}...prompt=yes
request.setCharacterEncoding( "GBK" );
String report = request.getParameter( "report" );
if( report == null || report.trim().length() == 0 ) throw new Exception( "请输入报表文件名及参数串report={无参数报表名}{报表1(参数1=value1;参数2=value2;...)}{报表2(参数1=value1;参数2=value2;...)}..." );
String prompt = request.getParameter( "prompt" );
String appmap = request.getContextPath();
String serverPort = String.valueOf( request.getServerPort() );
String serverName = request.getServerName();
String appRoot = "http://" + serverName + ":" + serverPort + appmap; %>
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" codebase="<%=appRoot%>/j2re-1_4_1-windows-i586-i.exe#Version=1,4,1,0" width="40" height="16" id="report1_directPrintApplet" style="vertical-align:middle">
<param name="name" value="report1_directPrintApplet">
<param name="code" value="com.runqian.report4.view.applet.DirectPrintApplet.class">
<param name="archive" value="<%=appmap%>/runqianReport4Applet.jar">
<param name="type" value="application/x-java-applet;version=1.4">
<param name="appRoot" value="<%=appRoot%>">
<param name="dataServlet" value="/reportServlet?action=1">
<param name="srcType" value="file">
<param name="fontFace" value="宋体">
<param name="fontSize" value="18pt">
<param name="fontColor" value="#0000FF">
<param name="backColor" value="#12632256">
<param name="icon" value= "<%=appmap%>/images/print.gif">//为打印控件的打印按钮设置图片,如果不设置此参数,则打印按钮上不显示图片。
<param name="label" value="打印">
<param name="needPrintPrompt" value="<%=prompt%>">
\<param name="scriptable" value="true">
</object>