Progress
Report Builder
User’s Guide


Displaying Date in “Month dd, yyyy” Format

Although Report Builder provides several date formats for displaying dates, you might want to spell out the date for reports, such as letters. To spell out the date, you first create the SPELL-DATE user-defined function, then create the Today-Date calculated field to provide the date, and finally insert Today-Date on the report layout.

Follow these steps to create the SPELL-DATE user-defined function:

  1. Choose Calculations User Defined Function. If there are UDFs defined, the User Defined Function dialog box appears.
  2. Choose the New button 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, bypassing the User Defined Functions dialog box:

  4. Type SPELL-DATE in the User Defined Function Name fill-in field.
  5. Type the following expression:
  6. SPELL-MONTH(Letter-Date) + “ ” + STRING(DAY(Letter-Date), “>9") + “,” + STRING(YEAR(Letter-Date),“9999")

    In this expression you spell out the month using the SPELL-MONTH built-in function and insert a space before printing the day and year. To format the day and year correctly, you must convert them to character strings using the STRING function, then specify the appropriate format. This expression will format out the date in the correct format, but you must pass it through the parameter, Letter-Date.

  7. Choose the New button to create the Letter-Date parameter. The New Parameter dialog box appears:
  8. Type Letter-Date for the Parameter Name.
  9. Select Date 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 user-defined function and return to the User Defined Functions dialog box. Report Builder automatically verifies the expression syntax.
  11. Choose Close to return to the report layout.

Now that you have created the user-defined function to spell out the date, you can create a calculated field to put a date into the report with this format.

Follow these steps to create the calculated field:

  1. Choose Calculations Calculated Field. If there are calculated fields defined, the Calculated Fields dialog box appears.
  2. Choose New to create a new calculated field. The New Calculation dialog box appears.
  3. If there are no calculated fields defined, the New Calculation dialog box appears immediately.

  4. Type Today-Date for the calculated field name.
  5. Type SPELL-DATE(TODAY()) for the expression. This expression instructs Report Builder to format the current value of the built-in function TODAY as the parameter to the SPELL-DATE user-defined function.
  6. Choose OK to create the calculated field and return to the Calculated Fields dialog box.
  7. Choose Close to return to the report layout.

To display the date in the report, insert the Today-Date calculated field on the report layout. When you preview or generate the report, Report Builder displays the current value of the TODAY( ) function (which should be the current system date). If you have difficulty creating the calculated field, see "Calculated Fields," for more information about creating calculated fields.


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