Previous Next

Building a Report That Contains Subreports : Tutorial 4: Building a report containing side-by-side subreports : Task 5: Build a data set for the payments subreport

Task 5:

In this procedure, you build a data set to indicate what data to extract from the Payments table. The payments subreport that you create later uses this data set.

1
2
Payments
3
4
On Query, in Available Items, expand CLASSICMODELS, then expand the Payments table to display the columns in the table.
5
SELECT Payments.paymentDate,
Payments.checkNumber,
Payments.amount
FROM Payments
WHERE Payments.customerNumber = ?
This statement selects the PAYMENTDATE, CHECKNUMBER, and AMOUNT columns from the Payments table. The WHERE clause has a parameter marker for the value of CUSTOMERNUMBER. When the report runs, the payments subreport gets the current CUSTOMERNUMBER value from the customers report.
6
Choose Finish to save the data set. Edit Data Set displays the columns specified in the query, and provides options for editing the data set.
7
1
2
3
o
o
o
o
o
4
8
Choose Preview Results to confirm that the query is valid and that it returns the correct data. If you created the SELECT statement and created the data set parameter correctly, you should see the results that appear in Figure 13‑7. These are the data rows that the query returns for customer number 103.

Figure 13-7 Data preview for the payments subreport

Figure 13-7
9

(c) Copyright Actuate Corporation 2008