JBoss.orgCommunity Documentation

Birt Plugin Reference Guide

Version: 1.0.0.GA

August 2008


1. Introduction
1.1. What is BIRT?
2. BIRT Support
2.1. BIRT Plugin Installation
2.2. JBoss BIRT Integration
2.3. Creating a BIRT Report
2.3.1. Create a Report Project
2.3.2. Create a Report
2.3.3. Build a Data Source
2.3.4. Build a Data Set
2.3.5. Create Report Layout
3. BIRT Report Designer
3.1. BIRT User Interface
3.2. BIRT Report Designer Features
4. Birt Integration
4.1. Adding JBoss BIRT functionality to the standard Seam web project
4.1.1. Prerequisites
4.1.2. Creating a web project
4.2. Hibernate ODA Data Source
4.3. Deploying a BIRT report

In this section we will focus more on all concepts that JBoss Tools integrates for working with BIRT.

In this chapter we suggest a step-by-step walk-through of creating your own BIRT report.

BIRT Designer is an intuitive and quite easy Eclipse-based set of plugins to make reports. In this chapter we will describe its interface and its features to you.

The central part of the user interface is the Layout Editor. It displays the whole process of building a report and contains the following tabs:

The next part of user interface is different Views that can be arranged around the Layout Editor area the way you like:

Here are the main BIRT Report Designer features:

In this guide we made a short overview of the BIRT plugin: its installation, support, features etc. that will help you to make your first steps with it.

This chapter covers the steps required for BIRT Integration

In this section you'll find out how to create a web project including Seam and BIRT capabilities

Follow the next steps to create a web project


  • Or choose the "JBoss BIRT Integration Web Project" configuration


  • Create the birttests.xhtml, testbirt.xhtml and testbirt1.xhtml pages as follows:

birttests.xhtml:


            <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                                                            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
            <ui:composition xmlns="http://www.w3.org/1999/xhtml" 
                                        xmlns:s="http://jboss.com/products/seam/taglib"
                                        xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"
                                        xmlns:h="http://java.sun.com/jsf/html" 
                                        xmlns:rich="http://richfaces.org/rich" 
                                        template="layout/template.xhtml">
            
            <ui:define name="body">  
                   <h:messages globalOnly="true" styleClass="message"/> <rich:panel> 
                    <f:facet name="header">Welcome to JBoss BIRT!</f:facet> 
                    <ul>
                           <li><s:link view="/testbirt.xhtml" value="Test Birt" /></li>  
                           <li><s:link view="/testbirt1.xhtml" value="Test Birt 1" /></li>  
                      </ul>
                      </rich:panel> 
            </ui:define>
            </ui:composition>
            

testbirt.xhtml:

            <p:birt xmlns:ui="http://java.sun.com/jsf/facelets" 
                                xmlns:s="http://jboss.com/products/seam/taglib" 
                                xmlns:p="http://jboss.com/products/seam/birt" 
                        designType="run" 
                        format="pdf" 
                        designName="test.rptdesign" 
                        title="JBoss Birt Test">
                        
                        <p:param name="sample" value="sample param"/>
            </p:birt> 
        

testbirt1.xhtml:

<p:birt xmlns:ui="http://java.sun.com/jsf/facelets"
                        xmlns:s="http://jboss.com/products/seam/taglib"
                        xmlns:p="http://jboss.com/products/seam/birt"
            designType="frameset"
            designName="test1.rptdesign"
            title="JBoss Birt Test"> 
 </p:birt> 
        
  • Try the tests out by accessing http://localhost:8080//birttests.seam with your web browser.





The birt tag recognizes most of the parameters described on the BIRT Report Viewer Parameters page. The attributes of the birt tag don't contain the "__" prefix. The param tag describes report parameters. It supports the following attributes:

  • name - the parameter name (required)

  • value - the parameter value (required)

  • isnull - specifies that a report parameter has a null value (optional)

  • islocale - specifies whether the parameter is localized (optional)

These tags are defined in the org.jboss.birt.core/resources/jboss-seam-birt.jar library that contains source.

It is possible to embed a BIRT report in some Seam xhtml page. For instance:

Example:



<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml" 
		xmlns:s="http://jboss.com/products/seam/taglib" 
		xmlns:ui="http://java.sun.com/jsf/facelets" 
		xmlns:f="http://java.sun.com/jsf/core" 
		xmlns:h="http://java.sun.com/jsf/html" 
		xmlns:rich="http://richfaces.org/rich" 
		xmlns:b="http://jboss.com/products/seam/birt" 
		template="layout/template.xhtml">
 <ui:define name="body">
  <h:messages globalOnly="true" styleClass="message" id="globalMessages"/>
  <rich:panel>
   <f:facet name="header">Products</f:facet>
   <b:birt designType="embed" designName="ProductCatalog.rptdesign" embeddable="true" masterpage="false"/>
   <div style="clear:both"/>
  </rich:panel>
  <div class="actionButtons">
   <s:button view="/ProductsEdit.xhtml" id="edit" value="Edit"/>
   <s:button view="/BirtProductsPdf.xhtml" id="BirtProductPdf" value="Product Catalog - PDF"/>
   <s:button view="/BirtProductsFrameset.xhtml" id="BirtProductFrameset" value="Product Catalog - Frameset"/>
   <s:button view="/BirtProductsEmbedded.xhtml" id="BirtProductEmbedded" value="Product Catalog - Embedded"/>
   <s:button view="/TopSellingProducts.xhtml" id="TopSellingProducts" value="Top Selling Products"/>
   <s:button view="/#{empty productsFrom ? 'ProductsList' : productsFrom}.xhtml" id="done" value="Done"/>
  </div>
 </ui:define>
</ui:composition>