Home Discussions Questions & Answers Synchronous Report Execution and BLOB Retrieval

Synchronous Report Execution and BLOB Retrieval

Avatar photoCustomer September 9, 2019 at 4:27 pm

I need to run a Blitz Report synchronously (immediately, not as a background concurrent request) from a custom application logic and retrieve the Excel output directly as a variable. Which API allows for this direct data retrieval?

Viewing 6 reply threads
  • Author
    Replies
    • Support September 11, 2019 at 3:15 am  

      You can execute the report synchronously using the PL/SQL API `XXEN_API.RUN_REPORT` . This procedure executes the report SQL and returns the Excel output directly in a BLOB output variable (`x_output_file`), along with the row count (`x_row_count`), generated filename (`x_filename`), and status details . This method is typically used when you want the results immediately, such as displaying a preview or integrating into a custom form action .

    • Avatar photoCustomer September 11, 2019 at 5:02 pm  

      What is the sequence of steps required before calling `XXEN_API.RUN_REPORT`?

    • Support September 12, 2019 at 12:06 am  

      The process involves three main steps , : 1) Initialize the application context using `xxen_report.apps_initialize` . 2) Create a new unique run ID using `XXEN_API.CREATE_RUN_ID_`, specifying the report name . 3) Set all necessary report parameters and runtime options (e.g., Template Name, Operating Unit value) using `XXEN_API.SET_PARAMETER_VALUE_` and `XXEN_API.SET_RUNTIME_OPTION` against the newly created run ID .

    • Avatar photoCustomer September 13, 2019 at 5:37 am  

      Can I use the `XXEN_API.DEFAULT_TEMPLATE_` function when setting the runtime template name for synchronous execution?

    • Support September 14, 2019 at 12:45 am  

      Yes, the synchronous API call supports dynamic template selection . You can call `XXEN_API.DEFAULT_TEMPLATE_` within the `XXEN_API.SET_RUNTIME_OPTION` procedure to automatically retrieve and use the user’s default template (if one is defined) for the specified report . This ensures the output uses the user’s preferred layout .

    • Avatar photoCustomer September 15, 2019 at 10:37 pm  

      How do I handle the case where the user might not have set a default template?

    • Support September 16, 2019 at 11:52 pm  

      If the user has not set a default template, the `XXEN_API.DEFAULT_TEMPLATE_` function should handle null or missing values gracefully, potentially returning a system default or null. Alternatively, you could hardcode a generic template name in the `XXEN_API.SET_RUNTIME_OPTION` call to ensure a template is always used, as shown in the example comment lines .

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

Login with: