Previous page

Next page

Report Designer - Replacing a Boolean with a Statement

Summary

The following applies to the Report Designer.

The following procedure will take the Boolean field Apprentice and place 'Is Apprentice' or 'Is not Apprentice' instead of the default '-1' and '0'.

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 Variable button and then click in the Detail band to create the Variable field.
  6. Click the Calc tab.
  7. In the main menu, click View and ensure that Events, Toolbox, and Messages are ticked.
  8. In the Report Objects window expand the Detail band and click the Variable1 component.
  9. In the Events window, click OnGetText.
  10. Click inside the Code Entry Window to view the code
  11. In the Code Toolbox, click the Language mini-tab. In the top section of the Code Toolbox, click Statement.
  12. Drag and drop if..then..else from the Code Toolbox to the Code Entry Window between 'Begin' and 'Value:='.
  13. Click the Data mini-tab.
  14. Click the Employee data query.
  15. Drag and drop the Apprentice field into the Code Entry Window in place of the term 'Expression', and then type '=true'.
  16. Type a term in place of the two 'statement' words, within single quotes and preceded by 'Value: ='. Make sure that the last statement has ';' after the final single quote:

    procedure Variable1OnGetText (var   Text:  String);

    begin

    if  plEmployee['Apprentice']=true

    then  Text  := 'Is Apprentice'

    else  Text  :='Is not Apprentice';

    end;

Previous page

Next page