Using Interactive Grid in APEX 5.1 it's not possible to call an apex page with defining a named report in the url.
This feature is not available in 5.1 and will perhaps be there in 5.2
https://twitter.com/patrickwolf/status/916272376312221697
In my current project the customer likes this feature and i tried to achieve it by using Interactive Grid JavaScript API on page load.
My idea was to set the custom report, reset this report and call the search action.
Here is the example code:
// set My Report ID
var ig_id = 'MY_REPORT_ID';
// set the Name of the Report
var ig_reportname = 'My Reportname';
// get the ID of the named report
var ig_reportid = fpp_ig_get_reportid_from_reportname(ig_reportname);
// call interactive grid to change to this report
apex.region(ig_id).widget().interactiveGrid("getActions").set("change-report", ig_reportid);
// then call the reset, because all old filters which where selected by the user should be remove
apex.region(ig_id).widget().interactiveGrid("getActions").invoke("reset-report");
// at the end call the search
apex.region(ig_id).widget().interactiveGrid("getActions").invoke("search");
Important:
The Code above needs to be called once on page load.
When using a dynamic action on page load you will get JavaScript errors that not all objects can be referenced. It seems that these actions where called to early.
Without knowing the best event i decided use the Custom Event ajaxStop in combination with a clientside condition which defines that it only runs when the first ajaxStop event is finished (and not every ajaxStop).
This approach works, but i get a side effect, that sometimes all lines inside my interactive grid are shown twice.
If the user hits the Search Button all lines are shown correct.
Here are some questions:
1. What is the best event/action to call the code above?
2. Not every time the user added a filter or searched before. Then a reset wouldn't be necessary. Is there any flag if the named report is changed or not in this session?
3. Any suggestions to solve my problem in a completly different way?
Thx for support