ireport打印问题
我用jetty跑的项目,在我本地,想做个用ireport打印功能,用的是Jaspersoft iReport Designer 4.5.1
项目中用的也是这个Jar包,在点击打印按钮额时候,跳转到controller里,向request里set相关参数,然后跳转到打印页面,页面代码
项目中用的也是这个Jar包,在点击打印按钮额时候,跳转到controller里,向request里set相关参数,然后跳转到打印页面,页面代码
<%@page language="java" contentType="text/html; charset=UTF-8"%>
<%@page import="java.net.URLEncoder"%>
<%@page import="java.net.URLDecoder"%>
<%@ include file="/common/taglibs.jsp"%>
<%
String params="",reportFile;
String caseNo =(String) request.getAttribute("caseNo");
String caseApplicant =(String) request.getAttribute("caseApplicant");
String caseType =(String) request.getAttribute("caseType");
String caseStartDateBegin =(String) request.getAttribute("caseStartDateBegin");
String caseStartDateEnd =(String) request.getAttribute("caseStartDateEnd");
String surplusDays = (String)request.getAttribute("surplusDays");
String caseEndDateBegin =(String) request.getAttribute("caseEndDateBegin");
String caseEndDateEnd =(String) request.getAttribute("caseEndDateEnd");
String caseStatus =(String) request.getAttribute("caseStatus");
String code =(String) request.getAttribute("code");
String chtype =(String) request.getAttribute("chtype");
reportFile ="/report/reportFiles/bangjiantongji.jasper";
params="method=printReport&reportFile="+reportFile+"&caseNo="+caseNo+"&caseApplicant="+URLEncoder.encode(caseApplicant,"utf-8")+"&caseType="+URLEncoder.encode(caseType,"utf-8")+"&caseStartDateBegin="+caseStartDateBegin
+"&caseStartDateEnd="+caseStartDateEnd+"&surplusDays="+surplusDays+"&caseEndDateBegin="+caseEndDateBegin+"&caseEndDateEnd="+caseEndDateEnd+"&caseStatus="+URLEncoder.encode(caseStatus,"utf-8")
+"&code="+URLEncoder.encode(code,"utf-8")+"&caseType="+URLEncoder.encode(chtype,"utf-8");
%>
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<script lanuage="javascript">
<!--
function unLoadReportSession()
{
window.frm.action = "${ctx}/unloadSession/unloadSession.do?method=upload";
window.frm.submit();
}
function loadReport()
{
var sWidth=window.screen.width;
var sHeight=window.screen.height-30;
window.resizeTo(sWidth,sHeight);
window.moveTo(0,0);
}
//-->
</script>
<body onunload="unLoadReportSession();" onload="loadReport()"
leftmargin="0" topmargin="0" rightmargin="0">
<form id="frm" method="post">
</form>
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "100%" HEIGHT = "100%" codebase="${ctx }/j2re.exe#Version=5,0,0,5"><NOEMBED></NOEMBED>
<APPLET CODE = "EmbeddedViewerApplet.class" CODEBASE="${ctx }/applets" ARCHIVE = "jasperreports-applet-4.5.1.jar,commons-logging-1.1.1.jar,commons-collections-2.1.1.jar" WIDTH = "100%" HEIGHT = "100%"></XMP>
<PARAM NAME = CODE VALUE = "EmbeddedViewerApplet.class" >
<PARAM NAME = CODEBASE VALUE = "${ctx }/applets" >
<PARAM NAME = ARCHIVE VALUE = "jasperreports-applet-4.5.1.jar,commons-logging-1.1.1.jar,commons-collections-2.1.1.jar" >
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.5.0">
<PARAM NAME="scriptable" VALUE="false">
<PARAM NAME = "REPORT_URL" VALUE="${ctx }/jreport.do?<%=params%>">
</APPLET>
</body>
</HTML>
...全文
相关推荐
ireport-all
然而,在实际操作中,用户可能会遇到各种打印问题,此时,ireport-all工具包就显得尤为重要。本文将深入探讨ireport-all在jasperReport中的应用,以及如何利用它来解决打印问题。
ireport+jasperreport开发中问题解决方案
可以通过删除报表源文件中的UUID字段来解决这个问题。5. **报表打印方向**:报表的打印方向可以在报表设计中设置,通常是在“打印设置”中选择横向或纵向。6.
Java Jsp 调用ireport动态模板打印
在实际应用中,还需要考虑性能优化、错误处理和用户体验等方面的问题,确保系统的稳定性和易用性。
iReport中文教程(目前最全的)
### 十七、其他内容#### 1 常规问题解决方案提供了一些常用问题的解决方案,例如打印百分比、计算组的发生数等。
struts+ireport报表在页面显示,导出,打印功能
开发者也可以通过JavaScript提供更复杂的打印控制,比如预览、设置页边距等。在实际项目中,为了保证用户体验和性能,可能还需要考虑异步加载、分页、缓存等问题。


