POJO 実行時データに基づくレポートを更新するには、レポートを作成するメソッドまたはデータ構造をインスタンス化します。次に、DatabaseController を使用してレポートのテーブルを変更します。
DatabaseController dbc = rcd.getDatabaseController();
String reportTable = "pojoReport";
dbc.setDataSource(data, ReportData.class, reportTable, reportTable);
<%@ page import="com.crystaldecisions.report.web.viewer.CrystalReportViewer,
com.crystaldecisions.sdk.occa.report.reportsource.IReportSource,
com.crystaldecisions.reports.sdk.*,
language="java" contentType="text/html; charset=ISO
String report = "pojoReport.rpt";
ReportClientDocument rcd = new ReportClientDocument();
DatabaseController dbc = rcd.getDatabaseController();
ReportData data1 = new ReportData("B.B.", "King", 6, new Date(25, 9, 16));
ReportData data2 = new ReportData("Muddy", "Waters", 7, new Date(15, 4, 4));
ReportData data3 = new ReportData("John Lee", "Hooker", 8, new Date(16, 8, 16));
ReportData data4 = new ReportData("Otis", "Rush", 9, new Date(34, 4, 29));
ReportData data5 = new ReportData("Buddy", "Guy", 10, new Date(36, 7, 30));
String reportTable = "pojoReport"; //The table name in your report.
java.util.ArrayList objects = new java.util.ArrayList();
dbc.setDataSource(objects, ReportData.class, reportTable, reportTable);
IReportSource reportSource = rcd.getReportSource();
CrystalReportViewer viewer = new CrystalReportViewer();
viewer.setReportSource(reportSource);
viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null);
| Business Objects http://japan.businessobjects.com/ サポート サービス http://japan.businessobjects.com/services/ |