Professional Documents
Culture Documents
Purpose ........................................................................................................................................................... 3
Use case .......................................................................................................................................................... 3
Details about the example .............................................................................................................................. 3
Tasks............................................................................................................................................................... 4
Open up Sybase WorkSpace and display “Help Contents” ........................................................................ 4
Create a new project ................................................................................................................................... 6
Build the Master report ............................................................................................................................... 9
Create a new report ................................................................................................................................. 9
Create a data source ...............................................................................................................................10
Create a data set .....................................................................................................................................13
Add a chart to the report ........................................................................................................................17
Format the chart and test the report .......................................................................................................20
Build the Detail report ...............................................................................................................................30
Create a new report ................................................................................................................................30
Create a data source ...............................................................................................................................32
Create a data set to display the different countries ................................................................................34
Create a report parameter ......................................................................................................................37
Create a data set to display the order detail for a particular country......................................................39
Add a dynamic cross tab to the report ...................................................................................................43
Format the chart and test the report .......................................................................................................51
Link the Master report to the Detail report and test ...................................................................................61
Link the Master report to the Detail report ............................................................................................61
Test the Master and Detail reports together ...........................................................................................64
Summary .......................................................................................................................................................66
Use case
Sub reports are a very common type of report. They are also referred to as Master Detail reports, or Parent
Child reports. BIRT is a flexible tool that allows the report developer to design many reports and integrate
them in sub report fashion via a few clicks of the mouse. The example in this cookbook demonstrates the
use of BIRT to create reports that are linked together: a main report with a bar chart displaying order totals
links to a sub report displaying details about the order breakdown for the particular country – product
categories, quantities and grand totals. Order details are presented in a report element called a “dynamic
cross tab”, which displays data in a row-and-column matrix. It is similar to a pivot table in Excel, where
you can dynamically arrange the underlying data into a spreadsheet-like format. Cross tabs are built on top
of “data cubes”, and data can be “sliced and diced” in various ways, as long as the data exists in the
underlying cube.
This example utilizes the following SYBASE products:
Sybase WorkSpace Data Analytics 2.5 which includes BIRT 2.2.2
Sybase IQ 15.1
Then, when the user clicks on a particular bar, a Detail report will be displayed. The Detail report will
show a cross tab with order totals categorized by part type, and the year and the year’s quarter in which the
orders were placed. Grand totals across yearly quarters and part type are shown.
Tasks
The tasks you will perform using this cookbook are the following:
1. Open up Sybase WorkSpace and display help contents (to learn where to go to get help)
2. Create a new project
3. Build the Master report
4. Build the Detail report
5. Link the Master report to the Detail report and test
In the next dialog, click on “Preview Results”, to make sure the query executes correctly:
select N_NAME
from TPCD.NATION
select sum(l.L_QUANTITY),
year(l.L_COMMITDATE) as YEAR,
quarter(l.L_COMMITDATE) as QUARTER,
c.C_MKTSEGMENT
from TPCD.LINEITEM l,
TPCD.CUSTOMER c,
TPCD.NATION n,
TPCD.ORDERS o
where l.L_ORDERKEY = o.O_ORDERKEY
and o.O_CUSTKEY = c.C_CUSTKEY
and c.C_NATIONKEY = n.N_NATIONKEY
and n.N_NAME = ?
group by YEAR, QUARTER, c.C_MKTSEGMENT
order by YEAR, QUARTER, c.C_MKTSEGMENT
Copyright © 2010 Sybase, Inc. All rights reserved. Unpublished rights reserved under U.S. copyright laws. Sybase and the Sybase
logo are trademarks of Sybase, Inc. All other trademarks are property of their respective owners. ® indicates registration in the
United States. Specifications are subject to change without notice. Printed in the U.S.A.