<%@ page import="com.crystaldecisions.report.web.viewer.CrystalReportViewer, com.crystaldecisions.sdk.occa.report.reportsource.IReportSource, com.crystaldecisions.reports.sdk.*, java.sql.*" language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> <% String report = "pojoReport.rpt"; ReportClientDocument rcd = new ReportClientDocument(); rcd.open(report, 0); DatabaseController dbc = rcd.getDatabaseController(); //Create the POJO data 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(); objects.add(data1); objects.add(data2); objects.add(data3); objects.add(data4); objects.add(data5); dbc.setDataSource(objects, ReportData.class, reportTable, reportTable); IReportSource reportSource = rcd.getReportSource(); CrystalReportViewer viewer = new CrystalReportViewer(); viewer.setOwnPage(true); viewer.setReportSource(reportSource); viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null); %>
SAP BusinessObjects http://www.sap.com/sapbusinessobjects/ Support services http://service.sap.com/bosap-support/ Product Documentation on the Web http://help.sap.com/ |