> ### Task 5: Group customer data by credit limit

> The report is currently sorted alphabetically by customer name. Recall that in the first tutorial, you specified that the rows in the table be sorted by customer name. In this procedure, you group the data by credit limit in intervals of 50,000. When grouping data, BIRT sorts the rows into groups first, then it sorts the rows within each group, assuming that there is a sort condition specified at the table level. Completing this task sorts the data rows within each credit limit group by customer name.

> 1 | Choose Layout to return to the layout editor.

> 2 | Right-click the Table tab, and choose Insert Group→Above.

> 3 | In New Group, follow these steps to specify grouping by credit limit in intervals of 50000:

> 1 | In Name, type the following text:

> credit_group

> 2 | In Group On, select CREDITLIMIT from the drop-down list.

> 3 | In Interval, select Interval from the drop-down list.

> 4 | In Range, type 50000.

> 5 | Use the default values for the other options. Choose OK. The table in the report design displays a group header and a group footer row, as shown in Figure 7-6. The table also shows the data element that the layout editor automatically added to the group header row. This data element serves as the group heading and, in the generated report, displays the first credit limit value of each group.

> Figure 7-6 Group header and group footer rows in a report design

> 4 | Select the [CREDITLIMIT] data element in the group header row. Do not select the [CREDITLIMIT] data element in the detail row.

> 5 | In Property Editor, under Properties, in General, choose the B button to format the group heading as bold text.

> 6

> Preview the report. Scroll down the report to view all the data. The report organizes data into four credit limit groups. At the beginning of each group, the following numbers appear in bold: 0, 61100, 113000, 227600. These numbers match the first credit limit value of each group. Within each group, customer names are sorted in alphabetical order. Figure 7-7 shows one of the four credit limit groups.

> Figure 7-7 Report preview showing one of the four credit limit groups

(c) Copyright Actuate Corporation 2013