Running a Genero ASCII report using GRW (compatibility report)
To run a Genero ASCII report as a compatibility report in Genero Report Writer, you must make some updates to the existing code.
MAIN
program block, to call the mandatory functions that
configure the
report: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
statement.
The formatting of the report is specified in the REPORT
program block of your
BDL program. (See Auto-formatting for
an alternative to the compatibility mode.) The report engine uses the default output
settings and displays a preview of the report in SVG format in the Report Viewer.
Additional SVG preview options are available, using the fgl_report_configureSVGPreview function. Use the fgl_report_configureCompatibilityOutput function to change the default
output settings.
The OrderReportASCII report in the Reports demo illustrates this feature.
Auto-formatting reports without 4rp
Beginning with version 2.40, auto-formatting of reports that have no report design document (4rp) is available, as an alternative to the compatibility mode. New functions have been added to provide generic report formatting. Currently only one design is provided, a simple list design that is compatible with the List Report template that ships with Genero Report Writer. This type of auto-formatting is particularly well suited to produce Excelâ„¢ output from arbitrary reports. See fgl_report_setAutoformatType and fgl_report_configureAutoformatOutput.
Report metadata
Functions allow you to add report metadata to compatibility reports. See Functions to set report metadata.
Mixing Genero ASCII reports, GRW reports, and compatibility reports
Genero ASCII (text-based) reports and GRW (graphical) reports can be run from the same Genero program without any additional calls.
However, running compatibility reports requires that compatibility mode is 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 fgl_report_stopGraphicalCompatibilityMode function.