Viewing a report using the Java Reporting Component

This is a basic sample designed to show you how to use the Viewer Tag Library to display a report using the Java Reporting Component.

To view a report
  1. Add a reference to the Viewer Tag Library descriptor file to the top of your JSP page.
  2. You must also ensure that the appropriate JAR files and additional support files are present.

    <%@ taglib uri="/crystal-tags-reportviewer.tld" prefix="crviewer" %>

    Note:    You can specify any name for the prefix attribute. The prefix determines what tag prefix to use to access the tag library's tags.

  3. Create an opening viewer tag.
  4. In this tag, you specify the viewer name and the type of report source.

    <html>

    <body>

    <crviewer:viewer viewerName="CrystalViewer" reportSourceType="reportingComponent" >

  5. Create the required report tag.
  6. This specifies the report to display and the session variable to cache the report source.

    Note:    You must always cache the report source when using the Java Reporting Component.

    <crviewer:report reportName="/reports/sample.rpt"/>

  7. Close the viewer tag.
  8. The JSP page is now ready to view the report named sample.rpt.

    </crviewer:viewer>

    </body>

    </html>



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