> ### Task 9: Create the payments subreport

> The payments subreport shows, in a row and column format, the payments that each customer made. It displays the payment date and amount paid. To iterate through the Payments data set rows and display them in a row and column format, you use a table element. This time, you use an alternate and quicker method to insert the table and the data set fields in the table.

> 1 | Choose Layout to resume editing the report.

> 2 | Choose Data Explorer, and expand Data Sets.

> 3 | Drag the Payments data set, and drop it below the orders subreport, in the detail area of the list.

> BIRT Report Designer inserts a table in the report, and places all the data set fields in the detail row of the table. BIRT Report Designer also inserts labels in the header row of the table. The report design should look like the one shown in Figure 12-20.

> Figure 12-20 Report design including the payments subreport

> 4 | Sort the payment rows by payment date.

> 1 | Select the Payments table.

> 2 | In Property Editor, choose Sorting.

> 3 | In the Sort page, choose Add to create a sort expression.

> 4 | In New Sort Key, specify the following values, then choose OK:

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

> | Use the default values for the other fields.

> 5 | Preview the report. The report should look like the one shown in Figure 12-21.

> Figure 12-21 Report preview showing repeated payment records
> The same payment records repeat for every customer because you specified a default value of 103 for customerNumber when you created the parameter, CustID, for the Payments data set. Just as you did for the orders subreport, you need to dynamically update the value of the CustID parameter for each customer in the master report.

(c) Copyright Actuate Corporation 2013