Some of the features in the Java Viewer that make your job easier include the capabilities to search the text of the report and to depict data contained in the report as a grid. In addition, the
Another useful feature is the capability for you to pick and choose elements of a Crystal report to display on the screen. Instead of displaying the entire report, your JSP application can show in the web page only pieces of the report that are relevant to your application. Let s say that you want to use in your application a graph based on data from a Crystal report. By using report
It is very common for users of your JSP application to need a report in a format that they can download and manipulate
Now that you have a good idea of what you can do with the Java Viewer, it s time to learn how to embed a Crystal report in your JSP application. You ll need to have a Java Application Server either installed and configured on your development computer or available on a network,
You also need to install the Java Reporting Component included with Crystal Reports 10 Developer or Advanced Developer Edition (Crystal Reports 10 Standard and Professional Editions don t include the Java Reporting Component). The Java Viewer classes are included in the JAR file included with these Crystal Reports 10 editions. When you initially insert the Crystal
Once you have the Java Application Server and the Crystal Reports 10 Java Reporting Component installed, you need to run the Java Application Server. You don t need to run the Java Reporting Component.
The Java Viewer classes are located in webreporting-
Windows C:\Program Files\Common Files\Crystal Decisions\2.5\java\lib
Unix crystal-root /java/lib ( crystal-root is the directory where the Java Reporting Component is installed)
Copy the JAR file and the CrystalReportEngine-Config.xml file to your JSP application WEB-INF/classes folder. The CrystalReportEngine-Config.xml file contains details of the Java Reporting Component configuration. This is required only by the Java Reporting Component, not by the other report engines.
Move all JAR files from the java folder to the lib directory of the application s WEB-INF folder. This ensures that all required libraries required by the Java Reporting Component and
<!-- Context Param -->
<!-- Context Param End -->
The Java Reporting Component can connect to the data source used by the Crystal report. The data source is typically a database managed by a Database Management System (DBMS) that is accessible using JDBC or JNDI data source.
However, a Crystal report might be designed using a different connection method such as ODBC or OLE-DB. In such cases, the Java Reporting Component automatically attempts to map this connection to the JNDI data source, which must be the server name specified in the Crystal report. This is only a requirement of the Java Reporting Component. You don t need to do this for the other reporting engines.
The Java Reporting Component needs to know where to locate the report source for the Crystal report that you want to use with your JSP application. The value of the
tag is the root directory used by the Java Reporting Component to locate the report source. Typically, each report source will have its own directory
You specify the location as the value to the reportlocation tag in the CrystalReportEngine- config.xml file. You ll find the CrystalReportEngine-config.xml file in the WEB-INF directory. The value of the reportlocation tag must be a
So, you might specify a relative path to the reportlocation tag similar to:
Relative URL to the Java Reporting Component location
(Remember that the Java Reporting Component JAR file is in /WEB-INF/lib directory.)