Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Cross Table Revenue By Product (BIRT)

< To: Report Developer Examples (BIRT)
This example is Bugzilla ID 190895. If you would like to contribute an example see the example contribution guidelines.

Introduction

This example illustrates using the Cross Table Element and the Cube Builder.

BIRT Version Compatibility

This example was built and tested with BIRT 2.2 RC0.

Example Files

Example Report Zipped

Description

When using the Cross Table element it is important to understand that is sources its data from a BIRT Cube, which is built on top of BIRT Data Sets.

In this example the data set is built first against the sample db and has the following query.

select *
from 
CLASSICMODELS.ORDERS,
CLASSICMODELS.CUSTOMERS,
CLASSICMODELS.ORDERDETAILS,
CLASSICMODELS.PRODUCTS
where
CLASSICMODELS.ORDERS.ORDERNUMBER=CLASSICMODELS.ORDERDETAILS.ORDERNUMBER
and
CLASSICMODELS.ORDERDETAILS.PRODUCTCODE=CLASSICMODELS.PRODUCTS.PRODUCTCODE
and
CLASSICMODELS.CUSTOMERS.CUSTOMERNUMBER=CLASSICMODELS.ORDERS.CUSTOMERNUMBER
and
CLASSICMODELS.ORDERS.STATUS = 'Shipped'

The cube is then constructed against this data set with Product Line and shipped date as dimensions and a calculated revenue as the measure. Dates are special dimensions and the group levels are generated automatically. Additional group levels can be added to dimensions using the drag and drop capability from the available data fields in the Cube builder. Revenue is caclulated using the expression:

dataSetRow["QUANTITYORDERED"]*dataSetRow["PRICEEACH"]

Although not shown in the example, multiple measures are supported.

Once the cube is complete you can drag the Cross Table element to the report canvas and drag the dimensions from the cube to the columns or rows and the measures to the intersection point.

The Cross Table element supports a GUI for setting the display group levels and adding aggregation totals. In this example product lines are cross tabulated with year/quarter revenue. The values are totaled by year, with grand totals in the last column and row.

Comments

Please enter comments below by selecting the edit icon to the right. You will need a Bugzilla account to add comments.


Back to the top