Progress
Report Builder
User’s Guide


Conditionally Including Memo Fields

If your form letter is composed of several memo fields, you can use the IIF or CASE function to conditionally include memo field text.

Follow these steps to conditionally print memo fields:

  1. Create a calculated field with the appropriate IIF or CASE expression.
  2. Insert the calculated field in your form letter where you want the memo text to appear.
NOTE: You can also use Properties Band Line Properties to assign a logical condition that will conditionally print any band line in the report. See "Bands," for more information.

For example, if you want to print the Pay-up memo field only if the addressee balance is past due, you can create a calculated field with the following expression:

IIF(Past-due, Pay-up, " ") 

This expression means that if the value in the Past-due field is true, Report Builder prints the Pay-up memo field. Otherwise, nothing prints. The empty quotation marks return an empty memo field without requiring such a field in your memo file.

NOTE: The quotation marks indicating the empty memo field must be the second return value in the expression.

Customers with a past due balance will receive letters including the text of Pay-up; paid up customers will receive letters without this text.

The CASE function can be used in a similar way to select from a series of memo fields. For example, to print different memo fields depending on the length of time customers’ bills are overdue, you might create an Overdue field that contains 0 if the bill is not overdue, 1 if it is between 30 and 60 days overdue, and 2 if it is more than 60 days overdue.

Create corresponding memos named THIRTY and SIXTY in a text file. Then create a calculated field with the following expression to conditionally print memo fields:

CASE(Overdue, 2, SIXTY, 1, THIRTY, " ") 

This expression means that if the value in the Overdue field is 2, print the SIXTY memo field; if the value in the Overdue field is 1, print the THIRTY memo field; if the value is 0 or any other value, print no memo field. Note that the quotation marks indicating the empty memo field must not be the first result in the expression.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095