Method to use the query of an Interactive Report, including all user defined filters, sort orders, etc., in a pl/sql procedure.
Change the settings of the IR and then click the Run Procedure button to see the results of the pl/sql procedure.
A similar (but more complex) method to get the query of a Classic Report can be found on the
Get Classic Report query page.
Note 1: make sure the columns you use in your code are always present in the query result. In this example, columns EMPNO and JOB are used in the code and therefore these columns are set "not hide-able" for the user.
Note 2:
In recent Apex versions the apex_ir.get_report function has been deprecated - thanks to Yuri for pointing out that one!
The documentation states that you should use apex_region.open_query_context instead, but that is not really a 1-on-1 replacement... This post gives an example of a way of using that:
https://srihariravva.blogspot.com/2021/10/interactive-grid-process-filtered-data.html