With that we can actually build really nice plugins enhancing the functionality.
However one thing you have to be aware of is that it will always give you the query of the "Report" view, so if you want to get the query behind the "Group By" view it's back to rebuilding the query manually.
Talking to Patrick Wolf during DOAG 2014 he asked me to write a blog post about it and showcase the behavior.
Therefore I have created a small demo on apexea.oracle.com using an interactive report and a dynamic action to see if the same behavior is also still in APEX 5.
The dynamic action gets the IR query using APEX_IR.GET_REPORT and also sets a read-only field to SYSDATE in order to show it actually fires on event "After Refresh".
You can check out the current behavior here.
So here's my wishlist for the APEX development team:
- Please give us the query also for the other view-types available for an interactive report.
- And if you want to supercharge the function give us an additional parameter for choosing whether we want the query for the currently displayed view-type or a specific one.
I imagine a possible function declaration like below:
FUNCTION get_report( p_page_id IN NUMBER , p_region_id IN NUMBER , p_report_id IN NUMBER DEFAULT NULL , p_view_mode_in IN VARCHAR2 DEFAULT NULL ) RETURN t_report;
So if you do not specify the fourth parameter you get the query for currently displayed view mode, similar to the third already available parameter.