Getting started developing BIRT reports for TPC using TCR

Getting Started with BIRT Reports
First time Setup
1. Install BIRT designer
a. Download and install BIRT Designer
http://www-01.ibm.com/software/brandcatalog/portal/opal/details?catalog.label=1TW10OT02
b. Configure DB2 JDBC drivers
Copy db2jcc.jar and db2jcc_license_cisuz.jar (or db2jcc_license_cu.jar) from
C:\Program Files\SQLLIB\java to C:\Program
Files\IBM\BIRTDesigner221\eclipse\plugins\org.eclipse.birt.report.data.oda.jdbc
_2.2.1.r22x_v20070919\drivers
c. Open C:\Program Files\IBM\BIRTDesigner221\eclipse\eclipse.ini and replace
with the contents below and save
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vm
C:\progra~1\IBM\BIRTDesigner221\jre\jre\bin\javaw.exe
-vmargs
-Xms40m
-Xmx512m
2. Configure workspace with TCR style package
a. Download workspace_birt221.zip and unzip to a directory
b. Run BIRT designer
C:\Program Files\IBM\BIRTDesigner221_new\eclipse\eclipse.exe and choose the
location of the unzipped workspace
c. Goto Window → Preferences

Find Report Design → Resource
and set to location of unzipped
workspace from step 2a
%unzipped_workspace%/TPCReport/resources/

Find Report Design → Template and set to location of unzipped workspace
from step 2a
%unzipped_workspace%/TPCReport/templates/
Click OK
3. Configure BIRT Designer to show all the views in the TPCREPORT schema
a. Goto Window → Preferences
b. Type JDBC in the textbox
c. Under JDBC Data Set set the Maximum number of tables in each schema to
display to 999
d. Click OK
4. Import TPCReport project from workspace
a. Goto File → Import select Existing Projects into Workspace
b. Cick Next
c. Choose the location of the unzipped workspace from step 2a for the root
directory
d. Click Finish
5. Configure the JDBC connection to the TPCDB
d. Open the Report Design perspective
e. Open the Navigator view and open the tpc.rptlibrary
f. Go to the Outline view -> Data sources and edit the TPCDB data source.
g. Change the hostname in the Database URL to the hostname of the TPC Server
h. Change the DB username and password and click OK
New Report Setup
1. Create a new BIRT report based on the TCR template:
a. File -> New -> Report
b. name the report file and click Next
c. Choose the TCR template (entries with TCR_*) for the type of report you want
to create.
d. Click finish
2. Add the TPCDB data source to the report from the tpc library.
a. Drag and drop the TPCDB from the Library Explorer to the Outline view.
Note: If the data source changes so will the reports data source since it is linked.
b. Save the report
c. Create Data sets with SQL queries.
Note: When writing queries against the TPC Exposed views always qualify the view
names with the TPCREPORT schema. i.e. TPCREPORT.STORAGESUBSYSTEM
For example see “Creating the sample SAN Filesystems Data Set” below
d. Use the Data sets in your report.
Viewing sample TPC reports
1. Open the Navigator view and you will see some Asset and Capacity reports
2. Doubleclick one of the .rptdesign files and it will open in the Layout view
3. To view the report click on the preview tab at the bottom of the report
4. Explore the layout of the report and the Data Set
5. Repeat steps for the other sample reports
Importing the sample reports to TCR
Creating the report package from the BIRT Designer
1. In the Navigator view right click on the TPCReport project and choose Export
2. Choose Archive File and click Next
3. In the To directory box type a directory path where TPCReport.zip will be created
i.e. c:\downloads\TPCReport.zip
4. Click Finish
Importing the report package into Tivoli Common Reporting inside TIP
5. Open TIP and login
6. Open the Reporting tree and choose Common Reporting
7. Right Click on Report Sets and choose Import Report Package
8. Browse or type in the path of the zip file you exported
Note: If you have previously imported this report package under Advanced Options
check Overwrite
9. Click Import
10. Under Report Sets you will see:
11. Click on Asset or Capacity
12. Click on a report under Reports
13. Right click and choose Data Sources...
14. Click on TPCDB and choose Edit
15. Change the hostname, userid and passsword for your TPCDB. This will change
the data source for all the TPC reports in the report package since the data source
is linked.
16. Click Save
17. Right click on a report and choose View As and choose a format
Viewing sample TCR reports
1.
2.
3.
4.
In the BIRT Designer
Open the Navigator view and open the samples folder
Open a report and click on Preview
Explore the layout of the report
TCR Resources
TCR information: http://www.ibm.com/developerworks/spaces/tcr
TCR forum:
http://www.ibm.com/developerworks/forums/forum.jspa?forumID=1177&categor
yID=15&ca=drs-fo&S_TACT=105AGX01&S_CMP=LP
Creating the sample SAN Filesystems Data Set
1.
2.
3.
4.
5.
Follow the steps in New Report Setup above
In the Data Explorer tab under Data Sets right click on the
SampleDataSet and choose delete
Under Data Sources right click on SampleDataSource and choose delete
Right click on Data Sets and choose New Data Set
Fill in the Data Set Name as below
6.
7.
8.
Fill in the Data Set Name as below
Click Next
Paste the query in the box overwriting what is there
select h.host_url, fs.mount_point, fs.space, fs.consumed_space, fs.available_space
from tpcreport.filesystem fs,
tpcreport.externalstoragevolume esv,
tpcreport.logicalvolume lv,
tpcreport.volume2disk alloc,
tpcreport.computersystem h
where fs.logical_volume_id = lv.logical_volume_id
and lv.logical_volume_id = alloc.logical_volume_id
and alloc.disk_id = esv.disk_id
and h.computer_id = fs.computer_id
9.
10.
11.
Click Finish
Click OK
You will have the following Data Set now: