Designing an interface for viewing report data
- Last Updated: January 17, 2024
- 3 minute read
- OpenEdge
- Version 12.8
- Documentation
In contrast to the ABL-controlled interface you saw in the last example, you need the following to create a user-controlled report viewing interface:
- A dialog box to contain the output, so report data does not require space on your main display.
- An OK button in the dialog box to let the user dismiss the report.
- A temporary file to contain the report data. Having the control block output to a temporary file eliminates the pausing behavior.
- An editor widget with scrollbars for navigating the report.
The next example creates a dialog box interface for the same report you saw in the last example. The notes that follow the exercise explain the new code techniques you need to make this interface work.
To create a dialog box interface for the report in Windows:
- Open i-10-02.p and run it. The following screen
appears:

- Click Report. The Report Output dialog
box appears:

The report data appears in an editor that you can scroll through.
- Click OK to dismiss the dialog box.
- Click Exit and then press SPACEBAR to return to the Procedure Editor.
Here is the code for this example:
i-10-02.p
|
|
These notes explain the new code techniques used in i-10-02.p:
- This editor is for the report data.
- The
OUTPUT TOstatement is your tool for directing output. This example directs output to the named file. Directing output is more fully discussed in a later section. - This
FOR EACHuses the default down frame, and theSTREAM-IOoption reduces all widgets to textual data without decorations. Using theSTREAM-IOoption is a requirement when outputting to any destination other than the screen. - Once you direct output to a destination, you need to close the output stream to return output to the default destination, which is the screen.
- This
ASSIGNstatement manipulates three editor attributes and one method to set up the dialog box. TheREAD-ONLYattribute prevents changes to the report content. TheSENSITIVEattribute enables the editor, making the scrolling functions available. TheTITLEattribute contains the dialog box title text. TheREAD-FILEmethod takes a valid filename and returnsYESorNOto indicate if the AVM successfully read the file contents into the editor. - You only want to bring up the dialog box if the logical variable
lStat equals
YES, which means that the AVM successfully read the file into the editor. - If you use a
WAIT-FORstatement in a dialog box, you must use theHIDEstatement to dismiss the dialog box. - On all platforms that OpenEdge supports, the output font designated by 3 is always a monospaced font, which are frequently used in printed reports. Assigning this font makes the editor contents mimic a printed report.