I have a number of different Interactive Reports within my application (using Oracle ApEx 4.1), on different pages.
On each of these reports, I have pagination but I have been asked to also provide on each of the reports, the overall total number of records, displayed somewhere on the page per report.
Is there a means of doing this functionality on Page 0 or do I need to calculate total records for each report separately?
Update for commenter
As mentioned in my previous comment, I added the new "p_use_filter" boolean parameter and set this to FALSE and all works fine.
I have another query. On one of the IR reports, within my where condition, I am using a bind variable but when I drill down on a report field that passes to the other report with the bind variable a STRING and then look at the backend SQL statement, I am getting an INVALID RELATIONAL OPERATOR error because the SQL has a WHERE condition like:
WHERE (CUSTOMER_NAME = ABC AIRLINES LTD )
i.e. it is trying to parse the SQL without single quotes around ABC AIRLINES LTD ?
I’d propose to retrieve the IR SQL and then execute that SQL wrapped in a
SELECT COUNT(*) from (...).Now, with Apex 4.2 you get the apex_ir package which can get the report SQL, but in pre 4.2 you do not have such a package. I have made one for myself, and I’ve used it for several things (I’ve blogged a bit about these for example).
The code needs some cleaning, but it is functional and has plenty of commentary in it. It’ll parse all the filters and transform them into SQL again. It does not handle computations or GROUP BYs. It’ll maybe have some kinks left in the cable somewhere, but it may depend on what you want to do with it. In this case it shouldn’t be a problem.
Git link
Basically, install the package in your schema, and then use code like this to run it: