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
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.