In the earlier section, we saw some of the power that charting can have with reports, by adding both the graphical representation of data and the interactivity for users to see the details of that data in a separate report. We also saw how to pass data through to the target report by using the expression. In this report, the hyperlink will take us to an internal bookmark, which means it will jump us to a location inside the same report containing the details for our report. We will also look at aggregating values inside the chart so that we can provide a simple query that just retrieves the necessary details and lets BIRT handle the tricky stuff for us.
EmployeeSalesPerformanceReport.rptDesign
. dsClassicCars
data source in the library. employeeSales
, using the following query:select CLASSICMODELS.EMPLOYEES.EMPLOYEENUMBER, CLASSICMODELS.EMPLOYEES.LASTNAME || ', ' || CLASSICMODELS.EMPLOYEES.FIRSTNAME name, CLASSICMODELS.ORDERDETAILS.PRICEEACH, CLASSICMODELS.ORDERS.ORDERDATE, CLASSICMODELS.PRODUCTS.PRODUCTNAME from CLASSICMODELS.EMPLOYEES, CLASSICMODELS.CUSTOMERS, CLASSICMODELS.ORDERS, CLASSICMODELS.ORDERDETAILS, CLASSICMODELS.PRODUCTS where CLASSICMODELS.ORDERS.ORDERNUMBER = CLASSICMODELS.ORDERDETAILS.ORDERNUMBER and CLASSICMODELS.EMPLOYEES.EMPLOYEENUMBER = CLASSICMODELS.CUSTOMERS.SALESREPEMPLOYEENUMBER and CLASSICMODELS.ORDERS.CUSTOMERNUMBER = CLASSICMODELS.CUSTOMERS.CUSTOMERNUMBER and CLASSICMODELS.PRODUCTS.PRODUCTCODE = CLASSICMODELS.ORDERDETAILS.PRODUCTCODE and CLASSICMODELS.ORDERS.ORDERDATE between ? and ?
startDate
and endDate
. employeeSales
dataset. PRICEEACH
column.(row["ORDERDATE"].getYear() + 1900).toString() + '-' + (row["ORDERDATE"].getMonth() + 1).toString()
This may not make much sense now, but we will explain it further in the next chapter.
NAME
column. EMPLOYEENUMBER
. OrderDate.
PRODUCTNAME
into the second column and PRICEEACH
into the third column. groupFooter
for the OrderDate
grouping. PRICEEACH
field for the salesDateGroup
. OrderDate
groupings header row. Select the Bookmark tab under the property editor. Use the following expression for the bookmark:row["EMPLOYEENUMBER"] + row["ORDERDATE"]
ChartHyperlink
for the Name.row["EMPLOYEENUMBER"] + row["ORDERDATE"]
Now, when we click on any of the different colored sections of the bar chart, it will bring us to the details section within our own report.