In order to facilitate testing and/or validation of report regions in an application, it might be useful to create a report region on Page 0 with the following
select region_name,region_source
from apex_application_page_regions
where source_type='Report'
and application_id=:APP_ID
and page_id=:APP_PAGE_ID
This would show the "source code" for any report region right on the same page.
But when a report region is defined on Page 0, the above query will not pick it up because APP_PAGE_ID resolves to the page being run and never 0. One way to address this might be to change the query above to
and (page_id=:APP_PAGE_ID or page_id=0)
This would work but many times the Page 0 region is setup to be conditionally displayed so the query would pick up the report region even on pages where it is not actually rendered. Actually the same issue exists even with regions defined on a page, if their display-when evaluates to false, it is not rendered on the page so the source for it should not be shown.
I guess what I am looking for is a way to determine if a report region is actually rendered on a page or not. In other words, is there a way to dynamically evaluate the Conditional Display attribute of the report region, just like the APEX show engine does it at runtime?
[An SQL wrapper around the internal function WWV_FLOW_CONDITIONS.standard_condition might be useful here but I don't want to use internal APIs unless there is no other way.]
Ideas? Thanks