Home › Discussions › Questions & Answers › Synchronous Report Execution and BLOB Retrieval

Synchronous Report Execution and BLOB Retrieval

Avatar photoCustomer Questions & Answers 7 replies

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?

7 replies

  • Support Enginatics

    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 .

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

  • Support Enginatics

    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 .

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

  • Support Enginatics

    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 .

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

  • Support Enginatics

    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 .

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