Previous page

Next page

Report Designer - Making Fields Uppercase

Summary

The following example shows you how to make the fieldname Address3 appear uppercase in the final report.

Procedure

You are editing a report definition.

  1. Click the Data tab.
  2. From the main menu, click File | New | Query Wizard.
  3. Select the Employee table.
  4. Click the Design tab.
  5. Click the DBText button and then click in the Detail band to create the DBText field.
  6. While the field is highlighted, click Address in the Data field combo list.
  7. Right-click on the field and select AutoSize to resize the field correctly.
  8. Click the Calc tab.
  9. In the main menu, click View and ensure that Events, Toolbox, and Messages are ticked.
  10. In the Report Objects window, expand the Detail band and select the DBText1 component.
  11. In the Events window, click OnGetText.
  12. Click inside the Code Entry Window.

    The following code is displayed:

    procedure  DBText1OnGetText (var   Text:  String) ;

    begin

    Text   :=

    end;

  13. In the Code Toolbox, click the Language mini-tab. In the top section of the Code Toolbox, click Function | String.
  14. In the String section, drag and drop UpperCase to the immediate right of 'Text :=' in the Code Entry Window.
  15. Click the Data mini-tab.
  16. Click the Employee query, and then drag and drop the Address3 field from the Code Toolbox to inside the brackets with 'S' in the Code Entry Window. Delete the letter 'S'. The code will now look like the following:

    procedure DBText1OnGetText (var   Text:  String) ;

    begin

    Text   := UpperCase(plEmployee['Address3']) ;

    end;

    Note: If you cannot see Address3, then see Report Designer - Select Fields.

Previous page

Next page