RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


The Low-Cost Solution for Serving Crystal Reports from a Java Server

Delivering Crystal Reports on the Web via commercial platforms can be pricey. The Crystal Reports Java Reporting Component library offers a cheaper solution: deploying Crystal Reports as a component on an open source Java Web server.

usiness Object's Crystal Reports platform has been the industry leader for report generation and formatting for many years now. While Business Objects provides Web-based delivery platforms for Crystal, the cost-prohibitive licensing leads many businesses to settle for deploying these reports as standalone documents that require a Crystal Reports viewer. However, Crystal's Java Reporting Component (JRC) library offers a cheaper solution: deploying Crystal Reports as a component on an open source Java Web server (Tomcat, JBoss, etc.).

This article demonstrates how to implement this JRC solution within a standard Java Web application WAR. The deployed reports will provide real-time visibility into data contained within a JDBC-compliant datastore. All you need is a proficiency in Java Web development, prior experience developing reports with Crystal Reports, and a Crystal Reports version that supports the JRC.

As of the time of this writing, the JRC is available only with the following versions:

  • Crystal Reports Developer X
  • Crystal Reports Developer XI
  • Crystal Reports Advanced Developer X
  • Crystal Reports Server XI

Exploit Crystal's JRC Features to Serve Real-Time Reports

By taking the following steps, you will exploit several key JRC features that enable Crystal Reports to bind to JDBC-compliant data sources, interpret Crystal's report formats, and instantiate viewer objects for display in a Web browser via a viewer plug-in (ActiveX, DHTML, JavaBean, etc.).

Java Setup
First, install a Java Development Kit (1.4 or later) if you don't already have one. Next, you need a database and a compliant JDBC driver for your database. If you don't already have these, Java DB should work fine for testing. Regardless of which database and driver you select, keep the driver handy. You'll make the driver available to Crystal later.

Crystal Setup
With the Java and database setup accomplished, you can turn your attention to Crystal. First, you need to ensure that the JRC is installed as a part of your Crystal distribution. To verify this, look for the java folder in one of the following locations:

Version 10: %INSTALL_LOCATION%\Common Files\Crystal Decisions\2.5\
Version 11: %INSTALL_LOCATION%\Business Objects\common\3.5\

By default, the installation location should be c:\Program Files, but it may be different on your system. In the event that you do not yet have the JRC installed, launch your installation media and locate the "Add Java Components" install option.

JRC Config
Once the JRC is installed, you need to configure Crystal to locate your JDK and database driver. You handle this via the settings in the CRDB_JavaServer.ini file located in the bin sub-folder of the java directory you just identified. Open the INI file with a text editor and locate the [common] section. Set the PATH to point to the bin directory of your JRE (your JDK bin will suffice if you do not have a separate JRE installed).

Next, make sure that the CLASSPATH variable points to the CRDBJavaServer.jar file located in Crystal's Java bin directory (same directory as the INI file). With both of these path settings, be sure to use backslashes rather than forward slashes.

Finally, set the IORFILELOCATION variable to a temporary location such as c:\temp.

JDBC Driver
The last setup step is putting the JDBC driver JAR file identified previously in a location where Crystal can use it. Locate the bin sub-folder of Crystal's java directory identified previously, and place a copy of the JAR there.

Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date