Using BIRT with Apex for PDF reports

One of the frequently asked questions in the Apex world is “How can I create a PDF report without BI Publisher”. The answers are always the same “use Apache FOP”, “use JasperReports”, but there is one solution that is not frequently given and that is “look at BIRT”. BIRT is an Eclipse-based open source reporting system for web applications, especially those based on Java and Java EE. BIRT has two main components: a report designer based on Eclipse, and a runtime component that you can add to your app server. BIRT also offers a charting engine that lets you add charts to your own application.


The BIRT site gives an excellent explanation how to install the Birt Report Designer in your Eclipse IDE or how to install a dedicated report designer, based on the same IDE. So no use for me to explain this. I will suffice to say that de report Designer is a Perspective within the IDE ( Window>Open Perspective > Other> Report Design).

The BIRT site also gives a lot of examples how to create a report. The report eventually will be a file with a rptdesign extension. In a nutshell, it goes like this:

  • Create a new project
  • Use as wizard the Business Intelligence and Reporting Tools > Report Project
  • Create a new report within the project using the appropriate template
  • Create the data source
  • Create the dataset
  • Drag and drop the dataset to the appropriate positions on the report
  • Do your layout thing
  • Save the report

Making a connection with Oracle

To create the data source that connects to an Oracle database you have to choose the JDBC Data Source option. However, after a fresh installation the Oracle Driver is not known yet. Click the button Manage Drivers…

making an connection

In the next screen you have to add the JAR file with the driver class. I had an ojdbc6.jar file from an Oracle client installation. As an alternative, if you have a JDeveloper or SQLDeveloper installation at hand, you should be able to find an ojdbcN.jar file.

After you added the JAR file, the Drivers tab will show you two extra drivers: oracle.jdbc.driver.OracleDriver and oracle.jdbc.OracleDriver. Edit the latter and fill in the template URL

edit driver

Now you can choose the Oracle driver in the data source creation wizard and you can fill in the right credentials

Runtime viewer

If you are like me you have always a Tomcat installation at hand. If not, it’s very simple to download at Apache Tomcat. On the BIRT-site you can download BIRT-runtime. From this zip-file, take the WebViewerExample and extract it to your Tomcat/webapps directory. Rename the directory to birt-viewer. Restart Tomcat and go to http://localhost:8080/ (or the dedicated Tomcatserver instead of localhost of course).
Choose the Manager. It should look something like this:


Click the birt-viewer hyperlink and choose on the next page the View Example.

next page

But look at the URL


This gives us a clue how to integrate with Apex.

Your report must be copied to the birt-viewer root directory. Look in the BIRT documentation for the setting such that the servlet will look in an alternative location.

The ojdbcN.jar file you used within the IDE must be copied to the Tomcat/lib directory to enable the server to find the right driver. Restart Tomcat after you copied the file.

Integration with Apex

I created a simple report, connected as scott/tiger that selected everything from DEPT and with a parameter P_DEPTNO. The URL to test this report is


The __format parameter in the URL controls, well, the format of course. You can also use values like doc and xls.

Knowing this, integration is rather trivial; just generate an hyperlink in any form that navigates to the URL with the right parameter(s).