Creating a report source using ReportClientDocument class

Before you can view or export a report using the SDK, you will need to obtain a report source from the JRC SDK.

To create a report source using ReportClientDocument
  1. In the Project Explorer view, go to the CrystalReportsDemo\WebContent folder.
  2. Right-click WebContent and click New > JSP.
  3. The New JavaServer Page dialog box opens.

  4. In the File name field, type ViewerSample.jsp.
  5. Click Finish.
  6. Double-click ViewerSample.jsp to open the document.
  7. Enter the code snippet:
  8. <%@page import="com.crystaldecisions.reports.sdk.*" %>

    <%@page import="com.crystaldecisions.sdk.occa.report.reportsource.*" %>

    <%@page import="com.crystaldecisions.sdk.occa.report.lib.*" %>

    <%

    Object reportSource = session.getAttribute("reportSource");

    if(reportSource == null)

    {

        ReportClientDocument reportClientDoc = new ReportClientDocument();

        String report = "/Sample Reports/Customer Profile Report.rpt";

        reportClientDoc.open(report, 0);

        reportSource = reportClientDoc.getReportSource();        

        session.setAttribute("reportSource", reportSource);

    }

    %>






Business Objects
http://www.businessobjects.com/
Support services
http://www.businessobjects.com/services/support/