Create an XML data file

Set up and configure output to XML from your reporting application.

The demo program OrderReport.4gl gives the user the option to output the report data to a file (OrderReportData.xml) in XML format.

The Reporting API function fgl_report_create ProcessLevelData File() instructs the Genero Report Engine to execute the report, outputting the data specified in the PRINT function of the REPORT program block to an XML file rather than to a Report Design Document. The output file is stored in your current project. The name of the data file is passed to the function as a String.

Changing the SimpleReport.4gl example program to use this technique, the MAIN program block becomes:
MAIN

   DEFINE handler    om.SaxDocumentHandler,  -- return value
          dataFile   STRING    -- name of XML file to be created

   --configure the report engine to output the XML file    
   LET dataFile = "./OrderReportData.xml"
   LET handler = fgl_report_createProcessLevelDataFile(dataFile)

   -- run the report, creating the XML file
   CALL runReportFromDatabase(handler)

END MAIN