The Web Archive
Create a Java WAR file or Web application directory structure according to the standard setup for a Java Web application. Place the JSP file you created earlier in the root of the app, and set up a
web.xml file inside the
WEB-INF directory and a
lib folder within
WEB-INF.
Required JAR Files
Several JAR files need to be available to your Web application at runtime (typically via the Web app's
lib directory). Copy all the files from the lib directory of Crystal's Java folder (identified under ‘Crystal setup') to your Web app (probably the
lib directory). Then copy Concurrent.jar, icu4j.jar, log4j.jar, xercesImpl.jar, and xml-apis.jar from the
java/lib/ext directory. Finally, copy the database driver JAR file to the same location.
Crystal Viewer Files
Crystal comes with a set of ActiveX and DHTML report viewer files that your application will need to access. You can find this folder at the Crystal Report base directory (identified under ‘Crystal setup') under the name
crystalreportviewers10 (Crystal X),
crystalreportviewers11 (Crystal XI), or
crystalreportviewers115 (Crystal XI Release 2). Copy this folder and its contents to the root of your Web application directory.
You must define a context parameter within web.xml to indicate where the Crystal viewer files can be located. This parameter assumes the root of your application as the base context. Thus, for this simple example, you simply need to declare the folder name as the location:
<context-param>
<param-name>crystal_image_uri</param-name>
<param-value>crystalreportviewers11</param-value>
</context-param>
Application Deployment
With the application complete, you are ready to deploy it to a Java Web server. If you don't already have one selected,
Apache Tomcat is an excellentand freechoice.
Once deployed, fire up the Web server and then browse to the application and test the report via your handy-dandy Web browser.
Crystallize Your Web Reporting
Visibility into real-time data is a critical aspect of enterprise information systems. Crystal Reports provides a very mature and capable solution for report generation and formatting, but its server-based solutions can be to work with difficult and expensive. If you need to Web-enable one or more Crystal reports, the J2EE/Java EE platform provides a capable and powerful mechanism to accomplish this.