To display a Crystal report, you must send a Crystal Web Request (CWR) to the Web Component Server. A Crystal Web Request for a Report Viewer includes the following in its URL query string: viewrpt.cwr
.
http://myServer/myVirtualDirectory/viewrpt.cwr
The request is handled by one of the Web Component Server's plugin DLLs, which analyzes the query string and loads the appropriate Report Viewer. For information on the available Report Viewers, see Choosing a Report Viewer.
Note: Requests that use viewrpt.cwr
allow the user to view Crystal reports that are contained within the Crystal Enterprise system. In order to view reports that exist outside of the Crystal Enterprise system, you must use the following syntax:
http://myServer/myVirtualDirectory/myReport.rpt
This example uses CSP scripting to request the Report Viewer for Java and display a report when the user clicks the View Report
link.
"<a target='_blank' href='viewrpt.cwr
"&apstoken=" & Server.URLEncode(LogonToken) & "&init=java" & "'> View Report</A>"
The resulting URL for this link looks something like this:
http://myAPS/myDesktop/viewrpt.cwr
The URL passes any information after the question mark (?) to the Web Component Server. Report Viewer parameters are appended to the query string with an ampersand (&).
In this example, the call to the Report Viewer takes two parameters: the ID parameter and APSTOKEN parameter. INIT is a parameter recognized by the Web Component Server (WCS). By setting the INIT parameter equal to "Java," you can force the WCS to use the Report Viewer for Java when displaying the report inside a browser.
If the user's browser does not support the technology used by the viewer specified, Java in this case, an error will occur or an empty web page will be displayed.
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |