浏览 4420 次
锁定老帖子 主题:JSP调用水晶报表问题
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2007-12-06
由于业务需求,要用jsp调用水晶报表,现在基本已经完成了,但是 报表上的打印和导出不能用,点击只是刷新一下,就没了。请问各位 大哥遇到过这样问题么?请赐教!非常感谢! 这里我把一个jsp页面贴出来: <%@page import="com.crystaldecisions.report.web.viewer.CrPrintMode"%> <%@ page contentType="text/html; charset=gb2312"%> <%@ page import="com.crystaldecisions.reports.reportengineinterface.*, com.crystaldecisions.sdk.occa.report.exportoptions.*, com.crystaldecisions.report.web.viewer.*, com.crystaldecisions.sdk.occa.report.reportsource.*, com.crystaldecisions.reports.sdk.*,com.businessobjects.samples.pojo.*, com.dne.kiss.smsreport.vo.StatEngineerPointReport, java.sql.*, java.util.*"%> <% String report = "reports/getEngineerPoint.rpt"; ReportClientDocument rcd = new ReportClientDocument(); rcd.open(report, 0); DatabaseController dbc = rcd.getDatabaseController(); //Create the POJO collection and populate it with data int i = 0; List list = (List) session.getAttribute("engineerPointList"); StatEngineerPointReport[] data = new StatEngineerPointReport[list.size()]; if (list != null && list.size() > 0) { Iterator iter = list.iterator(); while (iter.hasNext()) { data[i++] = (StatEngineerPointReport) iter.next(); } } //Create the result set from the collection of POJOs POJOResultSetFactory factory = new POJOResultSetFactory( StatEngineerPointReport.class); factory.setVerbose(true); POJOResultSet results = factory.createResultSet(data); ResultSetMetaData metaData = results.getMetaData(); //Set the resultset as the report datasource //Get the table name from the 'Set Datasource Location' dialog in the Crystal Reports designer String reportTable = "getEngineerTable"; dbc.setDataSource(results, reportTable, reportTable); IReportSource reportSource = rcd.getReportSource(); CrystalReportViewer viewer = new CrystalReportViewer(); viewer.setOwnPage(true); viewer.setReportSource(reportSource); viewer.setDisplayGroupTree(false); viewer.setPrintMode(CrPrintMode.ACTIVEX); //viewer.setPrintMode(CrPrintMode.PDF); //viewer.refresh(); viewer.processHttpRequest(request, response, getServletConfig() .getServletContext(), null); %> 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2007-12-06
我用的是javaBean连接水晶报表,用sql查出相应的list传到上面页面,然后显示。现在就是不知道导出和打印怎么做?也从望上找了很多方法,但感觉不太合适。因为项目比较紧,时间非常急,还多请各位帮忙?
|
|
返回顶楼 | |