Home Discussions Questions & Answers Scripted Export of Blitz Reports with Dependencies

Scripted Export of Blitz Reports with Dependencies

Avatar photoCustomer November 13, 2021 at 9:23 pm

I need to automate the migration of several specific reports (by ID) to QA. How can I use the Blitz Report API to export individual report definitions, ensuring I include all dependent List of Values (LOVs) and Assignments, and then write these files directly to a network-mounted directory for easy retrieval?

Viewing 4 reply threads
  • Author
    Replies
    • Support November 15, 2021 at 5:34 am  

      To export a single report programmatically, you should utilize the function `XXEN_API.export_report_` in the `XXEN_API` package, which takes the report ID as an input parameter. When calling this function, you can specify input parameters like `p_include_lovs` and `p_include_assignments` with a value of ‘Y’ to ensure all related LOVs and assignments are included in the generated XML CLOB. After obtaining the CLOB data containing the report definition and all selected related objects, you can use the standard Oracle procedure `dbms_xslprocessor.clob2file` to write the contents onto the database server filesystem.

    • Avatar photoCustomer November 16, 2021 at 3:00 am  

      The requirement is to save the files to the database server filesystem, not the application server. Is `dbms_xslprocessor.clob2file` the correct tool for this, and what constraints do I need to be aware of regarding the file path?

    • Support November 17, 2021 at 5:26 am  

      Yes, `dbms_xslprocessor.clob2file` is specifically designed to write large object (CLOB) data onto the database filesystem. When you use this procedure, you must point to a pre-defined directory name which is set up in `dba_directories` on the database server. Please ensure that the directory object referenced (e.g., ‘OUT_FILE_LOC’ in the provided examples) exists and the necessary database permissions are granted to the user executing the PL/SQL block to write files to that location.

    • Avatar photoCustomer November 17, 2021 at 2:08 pm  

      We actually need to export multiple reports at once, based on a search pattern in the report name. Is there a different API function that handles lists of IDs rather than just a single ID?

    • Support November 18, 2021 at 2:10 pm  

      Absolutely, for exporting multiple reports simultaneously, you should use the more generic function `XXEN_API.export_file_data`. This function accepts a parameter `p_type` set to ‘Reports’ and also takes a collection of report IDs (`p_ids` of type `fnd_table_of_number`) to export multiple definitions into a single consolidated XML CLOB file. This approach is often useful when automating migration tasks using shell scripts or when consolidating related reports for a single deployment batch. You can find detailed examples of how to populate the `l_ids` collection by querying `xxen_reports_v` to gather all the relevant report IDs based on your criteria, such as a name pattern like ‘%test%’, before calling the export function.

Viewing 4 reply threads
  • You must be logged in to reply to this post.

Login with: