Split a report into smaller files

You can split a batch report into individual files. This option is available only for PDF, RTF, and Excelâ„¢ reports.

To split a file, call the fgl_report_setRenderingHints function with the pxmlSplitDocument set to TRUE:

DEFINE renderingHints om.SaxAttributes
LET renderingHints=om.SaxAttributes.create()
CALL renderingHints.addAttribute("pxmlSplitDocument","true")
CALL fgl_report_setRenderingHints(renderingHints)
    RETURN fgl_report_commitCurrentSettings()
END FUNCTION

The report is split at the level of any page root, that is, any immediate child node of the document root (not including triggers). In other words, every page root creates a new file. For example, if the page root is a child of the "Order ID" trigger, there will be one output file for each order ID.

By default, the files are named using the pattern reportnumber.ext where:

  • number is an ascending 5-digit, 0-prefixed number starting with 00001.
  • ext is the document-specific file extension, for example pdf or xlsx.

For example, the files might be called report00001.pdf, report00002.pdf, and so on.

Set custom file names

To override the default file naming pattern:

  1. In the report design document, add an InfoNode as the first child of the page root and set the Name property to grwDocumentName, as in Figure 1.
    Figure: InfoNode for splitting document

    This figure shows the Report Structure. OrderReport.4rp has a child trigger for Group userid, which in turn has a child trigger for Group orderid. Under Group orderid is a PageRoot. The first child of PageRoot is an InfoNode called grwDocumentName
  2. Set the Value of the InfoNode to an expression that determines the file name, for example:
    "report"+orderline.orders.shiplastname.trim()+orderline.orders.orderid

    In this example, the files might be called reportDupont1.pdf, reportMiller2.pdf, and so on.

Note: File names are not automatically disambiguated, and files with duplicated names will be overwritten.