Home › Discussions › Questions & Answers › Exporting Multiple Reports to Separate XML Files

Exporting Multiple Reports to Separate XML Files

Avatar photoCustomer Questions & Answers 5 replies

We need to integrate our reports with a change management system, meaning each report requires its own XML definition file. How can I loop through a set of reports and programmatically export each one individually?

5 replies

  • Support Enginatics

    Instead of `XXEN_API.export_file_data`, which bundles exports, you should use the function **`XXEN_API.export_report_`** inside a PLSQL loop.

  • What procedure handles the naming and writing of each individual XML file?

  • Support Enginatics

    The writing is still handled by `dbms_xslprocessor.clob2file`. Within the loop, you retrieve the report name and ID, call `export_report_` for the XML CLOB, and then use `dbms_xslprocessor.clob2file` to write it to the file system using a filename derived from the report name.

  • How do I ensure spaces in the report name don’t break the filename?

  • Support Enginatics

    A similar script example uses `xxen_report.space_to_underscore(c.report_name)` to sanitize the report name for use as a valid filename.

  • You must be logged in to reply to this post.