Because the Crystal Report viewer components are shared across both the Crystal Enterprise Embedded Edition and the Crystal Enterprise Professional/Premium editions, there must be a common interface defined so the viewer can display reports generated using both types of report processing engines. This interface is called the report source. The report source is an object that both the Embedded edition and Professional/Premium editions supply that the viewer in turn communicates with to render the reports to the various forms of HTML.
There are three types of report sources:
Standalone Report Application Server: This is packaged as the Crystal Enterprise Embedded Edition.
Clustered Report Application Server: This is packaged as part of Crystal Enterprise Professional/Premium edition. This is the Report Application Server running as a service on the Crystal Enterprise framework.
Page Server: This is the primary report processing service as part of the Crystal Enterprise framework.
NOTE
Because of the special functionality of the Interactive and Grid viewers, they do not work with a Page Server–based report source.
The Java code in Listing 32.1 illustrates the first scenario where a report source object is obtained from the standalone Report Application Server.
NOTE
All the code listings provided in this chapter are provided in JSP/Java. Although the .NET/COM and the Java flavors of the RAS SDK share identical functionality, there are obviously language nuances associated with each of them. Code samples for additional language flavors are available for download from the www.usingcrystal.com Web site.
Listing 32.2 illustrates obtaining a report source when using the Report Application Server as part of Crystal Enterprise. Notice that the same ReportClientDocument object is used. The difference is in how the ReportClientDocument object is obtained.
→ For more information on using the IEnterpriseSession as associated Crystal Enterprise objects, see “Establishing a Crystal Enterprise Session,” p. 767
An alternative way to do this is shown in Listing 32.3.
//Retrieve the IEnterpriseSession object. IEnterpriseSession enterpriseSession = (IEnterpriseSession) session.getAttribute("EnterpriseSession"); //Use the IEnterpriseSession object's getService method to get //an IReportAppFactory object. IReportSourceFactory reportFactory = (IReportSourceFactory) enterpriseSession.getService("", "RASReportFactory"); //Use IReportAppFactory object's openReportSource method, passing it //the report ID to return the reportSource object IReportSource reportSource = reportFactory.openReportSource(reportID, Locale.ENGLISH); |
Listing 32.4 illustrates obtaining a report source object from the Page Server service from Crystal Enterprise Professional/Premium.
3.12.153.212