Viewing a report using an unmanaged RAS server

This is sample shows you how to use the Viewer Tag Library to display a report using an unmanaged Report Application Server.

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.

    <%@ 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. Set system property to specify the location of the clientSDKOptions.xml file.

    This file is used to set the location of the RAS server.

    <%

        System.setProperty("ras.config","C:\\temp");

    %>

    Note:    You can also set the location of the clientSDKOptions.xml file in the classpath.

  3. Create an opening viewer tag.

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

    <html>

    <body>

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

  4. Create the required report tag, specifying the report to be displayed.

    The reportName value is prefixed with rassdk:// so that the RAS server can correctly locate the file.

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

  5. 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/