
Crystal Reports for Borland JBuilder Java Viewer SDK Tutorials
12/8/2003 1:40 PM Copyright 2003 Crystal Decisions, Inc. All Rights Reserved. Page 2
How to Create a Report Source
Before you can use the export control or the viewer in your JSP pages, you must
obtain a report source.
Other report sources include the Crystal Report Application Server (RAS) and
the Crystal Enterprise Page Server. The RAS report source is used when it is
desired to remote the report processing aspect of your application, or when
programmatic report modification at runtime is required. The Crystal Enterprise
Page Server is also used to remote the report processing function, but in
addition, it provides a host of other services commonly associated with an
enterprise-wide reporting system. These services include:
• Staggering the execution of reports to minimize system load, commonly
referred to as scheduling
• Archiving snapshots, or instances, of processed reports for auditing or time
series analysis
• Zero-client ad-hoc analysis
• Maintaining a repository of report objects which can be reused or
centralized for single-point update
• Managing an enterprise-wide, distributed, clustered, fail-safe reporting
infrastructure
Creating a Java Reporting Component report source only requires you to have
the location of the report you wish to view or export. The report location can be
specified using a file system path, UNC address, or URL. For more information
on the Java Reporting Component report source and specifying paths, see
“Appendix A”. Also, for the Java Reporting Component to correctly retrieve
data for a report, the report’s data sources must be correctly specified through a
JDBC connection string, or, if desired, a Java Naming and Directory Interface
(JNDI) connection.
NOTE
The Java Reporting Component uses one of two mechanisms to establish connections to
data sources. At report design-time (i.e. when reports are designed using the desktop
visual report design environment) a report designer can establish a connection to a data
source via a hard-coded JDBC connection string or via a JNDI look-up. The JNDI lookup
has the advantage of employing indirection to delay data source binding. At runtime,
when a report template is processed by the Java Reporting Component, the hand-coded
JDBC connection string entered at design-time can be used, or it can be overridden in the
deployment descriptor (web.xml). The JNDI approach relies on a JNDI directory service
running on your application server to determine how to connect to the data sources
specified in a report. Once the connection information has been retrieved from the JNDI
server, the Java Reporting Component uses the information to establish a JDBC
connection to the data source. To ensure that the Java Reporting Component can
successfully establish a connection when retrieving report data, ensure that the JNDI
entries for the required data sources are correctly configured. For more information on
how to configure a JNDI data source entry, please consult your application server's and
JDBC driver's documentation.
1. Ensure that you have imported the JPEReportSourceFactory class and the
IReportSource and IReportSourceFactory2 interfaces.
<%@ page
import=”com.crystaldecisions.reports.reportengineinterface.JPEReportSourceFactor
y,
com.crystaldecisions.sdk.occa.report.reportsource.IReportSourceFactory2,
评论0