下例是一个简单的 JSP 页面,它演示了如何使用 DHTML 报表页面查看器来显示简单的报表。
<%@ page import="com.crystaldecisions.report.web.viewer.CrystalReportViewer" %>
<%@ page import="com.crystaldecisions.reports.sdk.ReportClientDocument" %>
<%
Object reportSource = session.getAttribute("reportSource");
if (reportSource == null)
{
String report = "/reports/sample.rpt";
ReportClientDocument reportClientDoc = new ReportClientDocument();
reportClientDoc.open(report, 0);
reportSource = reportClientDoc.getReportSource();
session.setAttribute("reportSource", reportSource);
}
CrystalReportViewer viewer = new CrystalReportViewer();
viewer.setReportSource(reportSource);
viewer.setOwnPage(true);
viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null);
%>
Business Objects http://www.china.businessobjects.com/ 支持服务 http://www.china.businessobjects.com/services/services.htm |