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. Ensure that the appropriate reference to the Viewer Tag Library's descriptor file is added at the top of your JSP page.

    You must also ensure that the appropriate JAR files and additional support files are present. If you are using a wizard, this is automatically done for you.

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

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

  2. Create an opening viewer tag.

    In this tag, you must specify the viewer name and the type report source that is being used.

    <html>

    <body>

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

  3. Create the required report tag.

    This specifies the report that is displayed.

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

  4. Close the viewer tag.

    The JSP page is now ready to view the sample.rpt report.

    </crviewer:viewer>

    </body>

    </html>



Crystal Decisions
http://www.crystaldecisions.com/
Support services
http://support.crystaldecisions.com/