Since the download works by just calling the page again with a Request value (CSV) for example, I think you could have a process that runs when the request is CSV and get the IR ID from the APEX dictionary for the current page (because of right now we can only have one IR per page).
where application_id = :APP_ID
and page_id = :APP_PAGE_ID
Hope this helps
Better yet, someone has already implemented something like t his:
Hmm. That's really useful but as far as I can see, it's geared towards only having 1 IR per page i.e.
application_id = :app_id
page_id = :app_page_id;
When APEX 5 comes along, you can have more than 1 on a page and so any solution needs to be future proof which I am not too sure this one is.
Nice start though.
Duncs, you're absolutely right, but we don't know how that will be implemented yet.
So this is as close as you're going to get until we get our hands on APEX 5
The closest you'll get to future proofing this is to have nice modular package doing this and then enhance it later on.