以下の例では、DHTML レポート ページ ビューアを使用して簡単なレポートを表示する方法を示す、簡単な JSP ページを取り上げます。
注 この例で使用したレポートは、チュートリアルには含まれていません。
<%@ 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://japan.businessobjects.com/ サポート サービス http://japan.businessobjects.com/services/ |