Free tutorials for Java, Eclipse and Web programming



Follow me on twitter

8. Deploying in Tomcat

8.1. Overview

The following explains how to use BIRT reports in Tomcat. In general you have to:

  • Install the BIRT webviewer in Tomcat

  • Export your BIRT project into a .jar file

  • Move the .jar file to the birt-install-directory/WEB-INF/lib directory

  • Move the report design file into the root directory of birt in tomcat

  • Restart Tomcat

8.2. Install BIRT in Tomcat

We will use a standalone Tomcat 6.0 which we assume is already installed. See Apache Tomcat Tutorial for details.

You need the "Deployment components of BIRT" http://download.eclipse.org/birt/downloads/ .

Copy the birt.war of this download into the Tomcat webappsfolder.

Tip

Currently you have to install org.eclipse.commons.logging separately into Tomcat. Download this lib from http://commons.apache.org/logging/ and put the jars into the lib folder of Tomcat.

The Birt example should be available under http://localhost:8080/birt/.If you see something like this, your Tomcat an your Web Viewer should work correct.

8.3. Install your BIRT reports in Tomcat

To run your own reports you have to copy the .rptdesign file in the root of the birt folder in Tomcat. To make your Java classes available export your project into a jar file.

After that the jar file has to be copied to the Tomcat webapps/birt/WEB-INF/lib/ directory. Restart the Tomcat and navigate to your report.

Your report should be found under http://localhost:8080/birt/frameset?__report=stock_report.rptdesign

Tip

If you want to export your report to PDF you also need the library iText from ( http://prdownloads.sourceforge.net/itext/itext-1.3.jar ) . Copy the iText.jar in "/birt-viewer/WEB-INF/platform/plugins/com.lowagie.itext/lib". Now restart the Tomcat.