BDL programs / Writing the Genero BDL report program |
This type of report is referred to as a compatibility report.
If you have an existing Genero BDL program (4gl) that creates an ASCII report, you can execute the program using the Genero Report Writer without changing the existing Report Driver or the existing Report program block, and without creating a Report Design document (4rp).
DEFINE handler om.SaxDocumentHandler IF fgl_report_loadCurrentSettings(NULL) THEN -- switch on Compatibility mode -- (run without 4rp file) LET handler = fgl_report_commitCurrentSettings() -- commit settings END IF
Switching on Compatibility mode overrides the "TO ..." part of the START REPORT BDL statement.
The formatting of the report will be that specified in the REPORT program block of your BDL program. (See Auto-formatting for an alternative to the Compatibility format.) The report engine will use the default output settings, displaying a preview of the report in SVG format in the Report Viewer. Additional SVG preview options are available, using the API function fgl_report_configureSVGPreview. The API function fgl_report_configureCompatibilityOutput can optionally be used to change the default output settings.
The demo report OrderReportASCII illustrates this feature.
New API functions allow you to add report metadata to Compatibility Reports. These functions are intended to be used for compatibility reports only. See Report Metadata functions. For regular reports, the metadata can be set in corresponding properties in the Properties View of the Report Designer.
Genero ASCII (text-based) reports and GRW (graphical) reports can be run from the same Genero program without requiring any additional calls.
However, running Compatibility Reports requires that Compatibility mode be switched on. Once Compatibility mode is invoked, it stays active throughout the program, running any subsequent Genero ASCII reports using the Genero Report Writer also. If your program needs to restore text-based output for a Genero ASCII report, you must call the API function fgl_report_stopGraphicalCompatibilityMode.