Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse BIRT Report Developer Guide
Previous Page Home Next Page

Previous Next

One of the benefits of grouping data is that you can add summary, or aggregate, information at the beginning or end of each group. In this procedure, you add the following aggregate information to the report:

Display the number of customers in each group

2
In the palette, under Quick Tools, drag an aggregation element and drop it in the second cell in the group footer row. Elements that are in the group footer appear at the end of every group.
3
In Aggregate On, select Group and credit_group. This value indicates that the COUNT function returns the number of rows in each credit limit group.
Figure 8‑12 shows the complete definition for the aggregation element.

Figure 8-12 Aggregation Builder displaying values for getting the count of customers in each credit limit group

Figure 8‑12
Aggregation Builder displaying values for getting the count of customers in each credit limit group
4
Choose OK. In the report design, shown in Figure 8‑13, the aggregation element displays the sigma symbol followed by the column binding name.

Figure 8-13 Report design displaying the aggregation element

4
Preview the report. The report displays the number of customers at the end of each group. Figure 8‑14 shows the number of customers, 37, for the first credit limit group.

Figure 8-14 Report preview showing a count for each group

Figure 8-15 Text specified for the text element

In a text element, the <VALUE-OF> tag supports the display of dynamic data. The expression, row["GRP_TOTAL_CUSTOMERS"], is a reference to the column binding you created to return the number of customers in each credit limit group.

Figure 8-16 Report preview showing the text displayed by the text element

Customers: 37      37
10
Delete the aggregation element from the second cell in the group footer row to remove the second total, which is now redundant.

Display the number of customers in the report

In the previous procedure, you added aggregate data by inserting the aggregation element from the palette. This time, you add aggregate data by creating a column binding through the table’s Binding page.

The Binding page, shown in Figure 8‑17, displays all the column bindings used by elements in the table. The right side of the page displays buttons that represent the actions you can perform with column bindings.

Figure 8-17 Binding page displaying the column bindings

3
In Aggregate On, select Table. This value indicates that the COUNT function returns the number of rows in the table.

Figure 8-18 Aggregation Builder displaying values for getting the count of customers in the table

Figure 8‑18
The new column binding, TOTAL_CUSTOMERS, appears on the Binding page, and is available for use by any element in the table.
A new table header row appears above the row that displays the column headings. The new row appears in color because it inherits the properties of the row below it.
8
Drag a data element from the palette, and drop it in the first cell in the new table header row. Elements that are in the table header appear at the beginning of the section.
"Number of customers: " +
2
In the lower pane of the expression builder, select Available Column Bindings, select Table, then double-click TOTAL_CUSTOMERS, the column binding you created to get the number of customers in the table.

Figure 8-19 The expression builder displaying the expression that refers to the TOTAL_CUSTOMERS column binding

Figure 8‑19
The expression builder displaying the expression that refers to the TOTAL_CUSTOMERS column binding

Figure 8-20 Column binding defined

Figure 8‑20

Figure 8-21 Report design showing a total count for customers

10
Preview the report. The report displays the number of customers at the beginning of the table, as shown in Figure 8‑22. The text is centered within the column. You re-format this text later.

Figure 8-22 Report preview showing a total number of customers


(c) Copyright Actuate Corporation 2009

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire