Sei sulla pagina 1di 13

SpagoBI BIRT Report Engine

Alessandra Toninelli
2013/11/08 15:50

spagobi_server - SpagoBI BIRT Report Engine

Table of Contents
1 What is BIRT ......................................................................................................................................................................
2 How to design a report with BIRT .....................................................................................................................................
3 How to configure a BIRT report in SpagoBI .....................................................................................................................
3.1 Using SpagoBI Datasource in BIRT report ..................................................................................................................
4 How to attach parameters to your BIRT report ..................................................................................................................
5 How to manage Internationalization ...................................................................................................................................
6 Cross Navigation .................................................................................................................................................................
7 Using SpagoBI Datasets in BIRT .......................................................................................................................................

Page 2 - last modified by Alessandra Toninelli on 2013/11/08 15:50

3
3
3
4
6
6
6
6

spagobi_server - SpagoBI BIRT Report Engine

SpagoBI BIRT Report Engine supports the execution of BIRT reports.


1 What is BIRT
2 How to design a report with BIRT
3 How to configure a BIRT report in SpagoBI
3.1 Using SpagoBI Datasource in BIRT report
4 How to attach parameters to your BIRT report
5 How to manage Internationalization
6 Cross Navigation
7 Using SpagoBI Datasets in BIRT

1 What is BIRT
BIRT is an Eclipse-based reporting system. As all common reporting systems, it has two main components:
a report designer based on the Eclipse platform
a runtime component that runs on your application server

2 How to design a report with BIRT


In order to design a report with BIRT you have to download the BIRT Eclipse plug-in which is provided in the context of
the Phoenix Eclipse project. You can for example donwload the 2.3.1 version of BIRT Eclipse plugin at the following URL:
http://download.eclipse.org/birt/downloads/build.php?build=R-R1-2_3_1-200809221151 You can download for example
the Windows Installer (birt-report-designer-all-in-one-2_3_1.zip) and unzip it in a local directory (e.g C:Programs).
Once you have unzipped the file, simply launch the eclipse.exe program and select the location where you want to create
your BIRT projects. Change the persepective to: "Report Design".
The main operations to create a BIRT report using the BIRT Eclipse plug-in are:
create a BIRT project: File - New - Project - Business Intelligence and Reporting Tools - Report Project
create a Report under a project: File - New - Report
create a Data Source: from the Data Explorer tab select "New Data Source" by right-clicking on the DataSources icon.
The jdbc driver you are using should belong to the path library of your Report project.
In Ubuntu the jdbc drivers must be placed in the following folder birt-runtimeyourVersionReportEnginepluginsorg.eclipse.birt.rep ort.data.oda.jdbc_yourVersiondrivers.
create a Data Set: once you have created and tested the data source connection, create a Data Set by right-clicking on
the Data Sets icon and selecting "New Data Set"
create your report taking fields from your DataSet.
For the complete list of BIRT reporting options and features please refer to the BIRT documentation that you can get in the
Help menu of the BIRT plug-in.
Once you have finished designing your report you can preview it and save it. All BIRT report templates are saved in files
with the .rptdesign extension. You will find them under the BIRT project you created.

3 How to configure a BIRT report in SpagoBI


Once you have designed and saved your BIRT report using the Eclipse plug-in you can make it usable in the SpagoBI
environment as for all other SpagoBI analytical documents.
Connect to the SpagoBI system by using a developer user id (e.g. bidev/bidev), go to the "Document development" section
and click on the "New Document" icon on the right upper side of the windows in order to create a new analytical document.
Fill in all the required fields:
Label (mandatory)

Page 3 - last modified by Alessandra Toninelli on 2013/11/08 15:50

spagobi_server - SpagoBI BIRT Report Engine

Name (mandatory)
Description (highly suggested)
Type (in this case select Report)
Engine (in this case select Birt)
Data source
...

Attach the template by browsing your file system and selecting the .rptdesign template file from the location you saved it in
the design phase with your BIRT Eclipse plugin.

3.1 Using SpagoBI Datasource in BIRT report


There are 3 ways to use a Datasource in a report BIRT:
Set fix reference to your DB inside the report while creating your Datasource (not recommended)

If your DataSource is defined in SpagoBI with JNDI type (RECOMMENDED). See the following example:

Add a parameter of type String in your BIRT report called connectionName. Do not assign to it any value.

Page 4 - last modified by Alessandra Toninelli on 2013/11/08 15:50

spagobi_server - SpagoBI BIRT Report Engine

Attach the parameter connectionName to your Datasource:

This parameter doesn't need to be added in SpagoBI as Analytical Driver. It will be set by SpagoBI automatically.
If your DataSource is defined in SpagoBI with JDBC type. See the following example:

Add 4 parameters of type String to your BIRT report named: driver , url , user , pwd. Do not assign them any value.
Attach them to your Datasource as in the example above.

Page 5 - last modified by Alessandra Toninelli on 2013/11/08 15:50

spagobi_server - SpagoBI BIRT Report Engine

4 How to attach parameters to your BIRT report


If you want to attach parameters to your BIRT report you have to work at two different stages:
define the parameters in the design phase using the BIRT Eclipse plug-in
define the corresponding analytical driver in the SpagoBI document
When you are designing a BIRT report, in the Data Explorer Tab you will find a Report Parameters icon; you can right-click
on it and select New Parameter in order to create a parameter. Give the parameter a name, a data type, a prompt text (in ordet
to test it in the BIRT Eclipse environment) and a default value. In the query in your Data Set, parameters are referred to by
using a '?' (question mark) character. After you have created your parameter you have to attach them to your Data Set. Select
your Data Set, double click on it or select the Edit function and then select the Parameters menu in the list on the left side of
the Edit Data Set window. Attach to each parameter of the Data Set the corresponding Report parameter paying attention to
the order in which you defined parameters (i.e. question marks) in your Data Set query.
Once you have defined parameters in the BIRT Eclipse template you may have to attach these parameters to the
corresponding SpagoBI document. In order to do this, connect to SpagoBI by using an administrator userid (e.g. biadmin/
biadmin) select the SpagoBI document and then clik on "New ..." in the analytical driver section of the document in the
bottom part of the SpagoBI document detail window. Select the analytical driver from your list or create it if it does not
exist.
IMPORTANT: the UrlName you give to your Analytical Driver in the context of the SpagoBI document must correspond to
the name you give to the parameter in the BIRT report template

5 How to manage Internationalization


If you want to menage dynamic internationalization in you BIRT report you can choose between two modality:
by standard labels
by local labels (with zip file)
In either way, the definition of the properties files is the same (the original Birt mode, cfr Birt documentation) what
changes is the location of these files.
In fact these files can be in a zip file with the template (.rptdesign) and this zip will be inserted in SpagoBI like document's
template. Or you can insert into SpagoBI explicitly the birt report (.rptdesign) and then copy properties file in the 'resources'
folder like a subfolder called 'birt_messages' (the equivalent of jasper_messages for jasper). Put attention that, in this last
way, those files are general for all documents Birt.

6 Cross Navigation
Cross Navigation

7 Using SpagoBI Datasets in BIRT


In the BIRT Engine you can define datasets using the ones youve already designed in SpagoBI server.. In this way you can
define a dataset on a File, a Qbe, a query, and use it in BIRT..
The steps to perform are very simple:
Open SpagoBIStudio and create a new BIRT report
Define a new data source of type SpagoBI

Page 6 - last modified by Alessandra Toninelli on 2013/11/08 15:50

spagobi_server - SpagoBI BIRT Report Engine

Page 7 - last modified by Alessandra Toninelli on 2013/11/08 15:50

spagobi_server - SpagoBI BIRT Report Engine

Define a new dataset of type SpagoBI. In the first page you should select the data source and give a name to the
dataset. This name is used only in the BIRT designer, its not the name of the datset in SpagoBI.

Page 8 - last modified by Alessandra Toninelli on 2013/11/08 15:50

spagobi_server - SpagoBI BIRT Report Engine

Click next, and in the second page insert the name of the SpagoBI dataset you want to import..

Page 9 - last modified by Alessandra Toninelli on 2013/11/08 15:50

spagobi_server - SpagoBI BIRT Report Engine

In the wizard you can see the output columns of the DataSet, the preview and the parameters.

Page 10 - last modified by Alessandra Toninelli on 2013/11/08 15:50

spagobi_server - SpagoBI BIRT Report Engine

SpagoBIStudio loads the list of the parameters linked to the dataset. In the parameters tab you can give a default value to
the parameter, or you can link the parameters of the dataset to the parameters of the report. In this way when you deploy the
document, you can use the parameters of the document as parameters of the dataset.

Page 11 - last modified by Alessandra Toninelli on 2013/11/08 15:50

spagobi_server - SpagoBI BIRT Report Engine

Page 12 - last modified by Alessandra Toninelli on 2013/11/08 15:50

spagobi_server - SpagoBI BIRT Report Engine

Note: if you want to enable the null as admissible value for the report you should define the configuration variable
DATA_SET_NULL_VALUE (with the manage configs functionalty), with the value that the parameters should take if no
value is specified

Page 13 - last modified by Alessandra Toninelli on 2013/11/08 15:50

Potrebbero piacerti anche