Progress
Report Builder
Tutorial
Defining New Fields
Although the report definition contains all the address information and several text fields, you have to create three more fields.
Follow these steps to create the fields:
- Create the Past–Due–Date calculated field to calculate when payment is past due using the following expression:
IIF(RUNTIME(), DATE(RUNTIME–PARAMETER("duedate")), 7/30/95)
This expression allows you to input a due date (duedate) when you run the report with the Report Engine. The RUNTIME() function checks whether you are passing a date using the RUNTIME–PARAMETER() function. If you are not using the Report Engine, RUNTIME() returns a false value, and the IIF function sets the value of Past–Due–Date to 7/30/95. See the Progress Report Builder Deployment Guide for a complete description of the Report Engine.
- Create the Memo–Choice calculated field to choose which memo to print based on the date specified by the Past–Due–Date field. Use this expression:
IIF(Past–Due–Date > TODAY(), Payment, Late–Notice)
This expression instructs Report Builder to compare the Past–Due–Date to the current system date. If the Past–Due–Date is after the current date, Report Builder uses the Payment memo. However, if the Past–Due–Date is before the current date, Report Builder uses the Late–Notice memo.
The Memo–Choice field allows you to print two different versions of the letter. In the first example form letter you insert a specific memo field in the report layout. To have the flexibility of printing different memos, you insert the Memo–Choice field instead of a specific memo field in the report definition.
- Create an aggregate field, Order–Total, that totals the Extended–Price field from the Order–Line table. When you choose New from the Calculated Fields dialog box, the New Aggregate dialog box appears. Notice that there is an Options button:
![]()
- Choose the Options button to specify the optional aggregate field settings. The New Aggregate dialog box expands to include three more settings:
![]()
- Specify the settings listed in the following table:
Specify Order–Num as the reset value so that Report Builder will add the prices of the items ordered for each order.
- Choose OK to return to the Aggregate Fields dialog box.
- Choose OK to return to the report layout.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |