JSP调用水晶报表问题

我用的框架是spring+ibatis+struts
由于业务需求,要用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);
%>
  • 0
    点赞
  • 0
    收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
©️2022 CSDN 皮肤主题:大白 设计师:CSDN官方博客 返回首页
评论
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值