> Task 6: | Create the customer master report

> You use a list element to create the master report and organize the orders and payments subreports within it. The list iterates through the customer data rows and creates the related orders and payments subreports for each record. For the sake of simplicity, the customer report displays just the customer name. It can, of course, display additional data, such as customer address, phone number, and credit limit.

> 1 | Choose Palette.

> 2 | Drag a list element from the palette, and drop it in the report. The list element appears in the report, as shown in Figure 13‑8.

> Figure 13‑8 | List element

> 3 | Associate, or bind, the list with the Customers data set.

> 1 | In Property Editor, choose the Binding tab.

> 2 | In Data Set, select Customers from the drop-down list.

> BIRT creates a column binding for each column in the Customers data set. Figure 13‑9 shows the binding information for the list.

> Figure 13‑9 | Binding information for the list element

> 4 | Choose Data Explorer, expand Data Sets, then expand Customers. The columns that you specified in the query appear below Customers.

> 5 | Drag CUSTOMERNAME from Data Explorer, and drop it in the detail area of the list. Figure 13‑10 shows what the report design looks like so far.

> Figure 13‑10 | Data set field in the list element

> 6 | Choose Preview to preview the report. The report should look like the one shown in Figure 13‑11. The report lists all the customer names in the order in which the data set returns them.

> Figure 13‑11 | Data preview for the master report

> 7 | Sort the customer names in ascending order.

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

> 2 | In the layout editor, select the list element. Hover the mouse pointer over the bottom left corner until you see the List tab, then choose the tab.

> 3 | In Property Editor, choose the Sorting tab.

> 4 | On the Sort page, choose Add to create a sort expression.

> 5 | On New Sort Key, specify the following values, as shown in Figure 13‑12:

> o | In Key, select CUSTOMERNAME from the drop-down list.

> o | In Direction, use the default value, Ascending.

> Figure 13‑12 | Sort definition

> Choose OK. The Sort page displays the sort expression that you defined for the list.

> Figure 13‑13 | Sort expression

> 8 | Preview the report. Customer names appear in ascending order.

(c) Copyright Actuate Corporation 2009