Procedure
|
You are editing a report definition.
- Click the Data tab.
- From the main menu, click File | New | Query Wizard.
- Select the Employee table.
- Click the Design tab.
- Click the DBText button and then click in the Detail band to create the DBText field.
- While the field is highlighted, click Address in the Data field combo list.
- Right-click on the field and select AutoSize to resize the field correctly.
- Click the Calc tab.
- In the main menu, click View and ensure that Events, Toolbox, and Messages are ticked.
- In the Report Objects window, expand the Detail band and select the DBText1 component.
- In the Events window, click OnGetText.
- Click inside the Code Entry Window.
The following code is displayed:
procedure DBText1OnGetText (var Text: String) ;
begin
Text :=
end;
- In the Code Toolbox, click the Language mini-tab. In the top section of the Code Toolbox, click Function | String.
- In the String section, drag and drop UpperCase to the immediate right of 'Text :=' in the Code Entry Window.
- Click the Data mini-tab.
- 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.
|