Home › Discussions › Questions & Answers › PLSQL API for Running Report and Returning BLOB Synchronously

PLSQL API for Running Report and Returning BLOB Synchronously

Avatar photoCustomer Questions & Answers 5 replies

For synchronous, immediate report generation within a PLSQL script (not running as a concurrent request), how do I run the report and capture the output file content directly?

5 replies

  • Support Enginatics

    You use the procedure **`xxen_api.run_report`**. This procedure executes the report query synchronously and returns the Excel output file content in an `x_output_file` parameter of type BLOB.

  • What initialization is needed before calling this procedure?

  • Support Enginatics

    First, you must call `xxen_report.apps_initialize` to set the session context. Then, you call `xxen_api.create_run_id_` to get a `l_run_id`, set any necessary parameters, and finally call `xxen_api.run_report` using that `l_run_id`.

  • Besides the BLOB, what other essential information does `run_report` return?

  • Support Enginatics

    It also returns `x_row_count` (the number of rows extracted), `x_filename` (the suggested output filename), `x_return_status`, and `x_msg_data`.

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