Use the example code
Use the example code that was generated by the Report Data Wizard.
You can create a report application using the generated BDL file, or the file can be incorporated as part of a larger application. We recommend that you use a different BDL file to contain the additional code that is required, rather than making changes in the generated file. This allows you to re-execute the Report Data Wizard without risking the loss of your changes.
Example MAIN function
This simple function illustrates the addition of BDL code:
MAIN
DEFINE handler om.SaxDocumentHandler -- report handler
DATABASE officestore --connect to the database
--call the mandatory functions that configure the report
IF fgl_report_loadCurrentSettings("myreport.4rp") THEN -- if file loaded OK
LET handler = fgl_report_commitCurrentSettings() -- commit the
-- file settings
ELSE
EXIT PROGRAM
END IF
-- run the report by calling the report driver contained in your
-- generated function
IF handler IS NOT NULL THEN
CALL run_officestore_to_handler(handler)
END IF
END MAIN