Using BIRT and Actuate with JavaServer Faces(JSF)

Jump to: navigation, search

Contents

Overview

The jsf4birt component library supports the rendering of BIRT‐based reports on pages within JavaServer Faces (JSF) Web applications. Report viewers implemented as JSF components using this library can then be easily adjusted through tag attributes. There are two components. A BIRT wrapper and an Actuate wrapper. The BIRT wrapper component displays BIRT reports created in BIRT’s Eclipse design tool. This component uses the BIRT runtime API. The component calls the appropriate part of the API from the BIRT runtime to get generated HTML code to put on the page. Everything is done on the server side following the usual JSF lifecycle processing. The Actuate wrapper component loads reports from an installed Actuate server. The component uses the Actuate JavaScript API to load and run reports on the page using client‐side processing.

Download and Install the jsf4birt Component Library

Download

Download the Exadel jsf4birt component library from the marketplace at the link below.

The jsf4birt wrapper depends on the BIRT Runtime in order to render and display BIRT report designs. The current version of the jsf4birt wrapper will work with either BIRT 2.3.2 or BIRT 2.5.2. You should also download a BIRT Report Designer in order to create new BIRT report designs.

Install

The download ZIP file contains a comprehensive installation guide but the basic steps are:

Installing the jsf4birt component

  • Uncompress the ZIP containing the jsf4birt wrapper and read the license.
  • Navigate to the TLDocs folder and open index.html to find the documentation

The next few steps assume you have a web application configured for JSF and Facelets that you are going to be adding support for the jsf4birt wrapper. If you don't, skip the rest of the install steps and just download a complete demo web application as a WAR file from here

  • Copy all the JARs from the BIRT Runtime /ReportEngine/lib directory into your application's /WEB-INF/lib directory.
  • Create a directory named platform in your WEB-INF folder.
  • Copy the /Report Engine/plugins and /ReportEngine/configuration directories to the new 'platform' directory you just created.
  • Copy the jsf4birt.jar to your /WEB-INF/lib directory.

Download and install BIRT iServer Trial

To use the actuateWrapper, you will need to download and install a trial version of the BIRT iServer Trial.

Instructions to Download and Install BIRT iServer

Testing the jsf4birt component

Creating a simple BIRT Report Design

Launch the BIRT Designer that you downloaded in a previous step.

  • Switch to the Report Design perspective
  • File | New | Report Design - Just pick the blank template and name it whatever you want.
  • Right-click on the report and insert a Label. - Just keep it simple at first by not including any external resources or database connections.
  • Save the report design and copy the rptdesign file to a folder in your web application

Testing the jsf4birt:birtWrapper

  • Add the following namespace attribute to your HTML tag
xmlns:birt="http://jsf4birt.components"
  • Use the birtWrapper similar to below
<birt:birtWrapper id="report" reportDesign="/Reports/birt_report.rptdesign">
 <f:param name="MyParam" value="Something" />
</birt:birtWrapper>
  • Below is an example BIRT Report integrated as a JSF component.
Example of jsf4birt rendering

Testing the jsf4birt:actuateWrapper

  • Add the following context parameters to the web.xml so you application knows where to find the Actuate iServer.
<context-param>
 <param-name>actuate.serverUrl</param-name>
 <param-value>http://localhost:8900/iportal</param-value>
</context-param>

<context-param>
 <param-name>actuate.serverLogin</param-name>
 <param-value>administrator</param-value>
</context-param>

<context-param>
 <param-name>actuate.serverPassword</param-name>
 <param-value></param-value>
</context-param>

<context-param>
 <param-name>org.eclipse.birt.configPath</param-name>
 <param-value>configuration/config.ini</param-value>
</context-param>
  • Add the following namespace attribute to your HTML tag
xmlns:birt="http://jsf4birt.components"
  • Use the actuateWrapper similar to below
<birt:actuateWrapper id="report" reportName="/Home/administrator/Customer Dashboard.rptdesign"
runWhenRendered="true">
 <f:param name="MyParam" value="Something" />
</birt:actuateWrapper>
  • Below is an example BIRT Report from the BIRT iServer integrated as a JSF component.
Example of jsf4birt actuateWrapper rendering
Views