Progress
Report Builder
User’s Guide


Calculating the Amount of Deposit

In this example you create a UDF to calculate how much money a customer must pay, based on the order amount.

Follow these steps to create the DEPOSIT user-defined function:

  1. Choose Calculations User Defined Function. If there are UDFs defined, the User Defined Function dialog box appears.
  2. Choose New to create a new UDF. The New User Defined Function dialog box appears.
  3. If there are no UDFs defined, the New User Defined Function dialog box appears immediately.

  4. Type DEPOSIT in the User Defined Function Name fill-in field.
  5. Type the following expression:
  6. IIF(Amount < 500, Amount * .10, Amount * .15)

    This expression calculates the amount of the deposit based on whether the order amount is less than or greater than $500. If the order is less than $500, then the deposit is 10% of the order. If the order is greater than or equal to $500, then the deposit is 15%.

    Because UDFs are not associated with specific reports, you cannot specify a database field name in the expression. You must create an amount parameter through which to pass the order amount.

  7. Choose the New button to create the Amount parameter. The New Parameter dialog box appears.
  8. Type Amount for the parameter name.
  9. Select Numeric as the parameter type, then choose OK. Report Builder returns you to the New User Defined Function dialog box.
  10. Choose OK to create the function and return to the User Defined Function dialog box. Report Builder automatically verifies the expression syntax.
  11. Choose Close to return to the report layout.

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