Progress
Report Builder
Tutorial
Accessing and Ordering Data
To access and properly order the data for this form letter, you must follow these steps:
For this report, you don’t have to specify a new sort order.
Define the Joins
Joins are user-defined connections between tables that allow Report Builder to gather data from more than one table for a report. When you create a report definition, you specify the master table, which is the database table that Report Builder uses as the initial source of data for the report. In addition to drawing information from the master table, Report Builder can draw information from additional tables, called related tables. To access these related tables you join them to the master table or to each other.
To create a join between tables, you define a join field pair. A join field pair is made up of one field from the controlling table and one from the related table. The controlling table is the table used to initiate the join. The related table is the table to which you are joining the controlling table. Because you can join tables to a related table, a table can be the related table in one join and the controlling table in another join.
In this report, you need to access data in the Customer and Item tables. Because these tables do not share a common field, you must define joins through two other tables. All the records resulting from these joins comprise a composite table. This table is not a literal table, but a collection of all the accessed records.
See the joins chapter in the Progress Report Builder User’s Guide for a complete description of database joins.
Follow these steps to define the first join for this report:
- Choose Database
Joins. Because this is the first join for this report, the New Join dialog box appears:
- Select the Order table from the Join To Table drop-down list. Order becomes the related table.
- Choose the New Field Pair button. The New Join Field Pair dialog box appears:
![]()
First, look at the From Table field. Because Customer is the master table and this is the first join for the report, it is the only table available as the controlling table. Now look at the From Table selection list. Notice that it displays all the fields in the Customer table, which is the controlling table for this join.
By default, Report Builder selects the first field that appears in both the controlling and related tables. Therefore, because Cust–Num appears in both the Customer and Order tables, Report Builder highlights the Cust–Num fields in both the From Field and To Field selection lists. Because you want to define the join on the selected Cust–Num fields, do not select any other fields.
- Choose OK. Report Builder returns to the New Join dialog box. The join fields you specified appear in the Join Fields list:
![]()
- Choose OK. The Joins dialog box appears:
![]()
The Joins dialog box lists the new join. A full description of how Report Builder interprets the join appears in the lower portion of the screen.
Follow these steps to define the remaining necessary joins:
- Choose New. The New Join dialog box appears.
- Select the Order–Line table from the Join To Table drop-down list. Order–Line becomes the related table for this join.
- Choose the New Field Pair button. The New Join Field Pair dialog box appears.
Because the Order table was the related table in the previous join, Report Builder selects it by default as the controlling table for this join. Report Builder also selects the Order–num field from both the Order and Order–Line tables to create the join field pair.
- Choose OK. Report Builder returns to the New Join dialog box. The join fields you specified appear in the Join Fields list.
- Choose OK. The Joins dialog box appears.
- Choose New. The New Join dialog box appears.
- Select the Item table from the Join To Table drop-down list.
- Choose the New Field Pair button. The New Join Field Pair dialog box appears.
Again, Report Builder anticipates what table and fields you want to use for the join.
- Choose OK. Report Builder returns to the New Join dialog box. The join fields you specified appear in the Join Fields list.
- Choose OK. The Joins dialog box appears:
![]()
- Choose Close to return to the report layout.
Define a Filter
A filter is a set of conditions that allows you to narrow the focus of a report to the specific data you want to display. Filters can consist of one or more conditions that specify what data Report Builder is to retrieve for the report.
When you create a filter, you specify one or more conditions by which Report Builder limits the data it displays. Each condition contains:
If you are specifying multiple conditions, also include:
Lastly, you can also reverse the result of the comparison by using the NOT operator.
See the filter chapter in the Progress Report Builder User’s Guide for a complete description of filter conditions.
Because you are recalling only one All Around Sports product, you must define a filter condition to generate letters for only those customers who purchased the defective product.
Follow these steps to define a filter condition:
- Choose Database
Filter. The Insert Filter Condition dialog box appears:
![]()
- Select Item.Item–Num from the Field drop-down list. Report Builder tests the value in the Item–Num field.
- Type = in the Comparison field.
- Type 9 in the Compared To field.
The following dialog box shows how the expression should appear:
![]()
- Choose OK. The Filter dialog box appears:
![]()
- Choose OK to save the filter and return to the report layout.
When Report Builder invokes the filter, it only displays the information for customers who have purchased item number 9, which is the All Around Sports swim goggles.
Attaching the Memo File to the Report Definition
Report Builder generates reports by accessing data and displaying it according to the criteria in the report definition. In the first task you specified the text and fields for the form letter when you prepared the
Letter1.txt
memo file. Because this information is in a file separate from the report definition, you must attach it to the report definition so Report Builder can access the memo file’s contents.Follow these steps to attach the memo file.
- Choose Report
Attach Memo File. The Attach Memo File dialog box appears.
![]()
- Type c:\rbtutor\Recallet.txt in the Memo File field. Report Builder assigns Recallet as the file alias.
- Choose OK. When you insert fields, the name of each memo defined in the memo file appears in the field list under the Memo Fields heading under User Defined Fields.
When you save a report, Report Builder saves the memo file selection in the report definition.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |