1
votes

Recently I've come across the problem in Oracle Apex 4.2.0003 with saving pagination in Interactive Report. I have a page, in which there are two reports: the first one is Classic, and the second one is Interactive, at that they are working as "master-detail".
Besides, Interactive report has both data from a view and HTML-elements like icons with links to modal or pop-up windows. All in the page works fine except one thing: refreshing of it leads to resetting the pagination of "detail" Interactive report in spite of full refresh or partial (without resetting the Classic, "master" one).

I've tried to solve the problem with javascript: I've written some code, which got current pagination from page and saved it just before updating, and the updating itself went by means of function gReport.navigate.paginate. I could use this way, but it didn't take into account the cases when there were less rows than the count of them chosen in the Interactive Report panel (where also there are search bar etc.).
Another way of solving my problem I'm considering now is getting information about current row count per page from the view APEX_APPLICATION_PAGE_IR_RPT, but I don't know how to get not information from the column interactive_report_id, but from the one named report_id.

Of course, I have the way which leads through getting information by having session ID and the kind of view (which can be customized in Interactive Report panel), but I can't say I like it.

So I have the following question: how to make Interactive Report NOT to reset pagination in my case? Is it possible to make it easier than to get the information from APEX views?

1

1 Answers

2
votes

This is a question which pops up from time to time and this is still an issue in apex 5, being that there is no supported way to do this, even though all it requires is opening up the api a bit so we wouldn't need to hack it.
You can use gReport.navigate.paginate for sure, and I'd recommend to go with that. Mind though: it's unsupported by Oracle (as in: undocumented) and it does not work in apex 5 (the JS for IRs has been redone). However, even in apex 5 the methodology remains similar: just "hack" it.

I would NOT query views. You still need IDs from the report and communicate with the backend, and you'll create many more problems than you actually need.

Just figure out in javascript when there is pagination or not.

HTML in the IR when there are more rows than the allowed rows per page:

<td colspan="18" class="pagination" align="left">
  <span class="fielddata"> 1 - 15 of 1878 
    <a href="javascript:gReport.navigate.paginate('pgR_min_row=16max_rows=15rows_fetched=15')">
      <img src="/i/jtfunexe.gif" title="Next" alt="Next" align="absmiddle">
    </a>
  </span>
</td>

HTML when there are less or equal rows than amount allowed:

<td colspan="18" class="pagination" align="left"><span class="fielddata"> 1 - 1 of 1 </span></td>

So: you can check if there is an anchortag in there or not.
If yes: perform your 'paginate' function.
If not: do a refresh.