This content has been marked as final. Show 4 replies
need to run a report while also navigating awayWhy are you doing this ? Even if you were successful in what your were trying to do, doesn't it redirect to the other page without displaying the report(or maybe showing it for a second or two before redirecting) ?
Anyway if you want to show the report and then redirect to another page, here's on method that should work
Add the following to the footer region of the Report region
Note: Change the page Number from 1 to the actual page to be redirected to
Thanks for the prompt reply.
As to why I am doing this, here is the scenario.
A work schedule is generated based on transactions in the system (and their status). The schedule is created by the user selecting unscheduled work in a interactive report, using checkboxes. Once the selection has been made, the user then clicks on a "Schedule" button. This executes a piece of PL/SQL which creates a schedule and updates the selected transactions with the schedule reference. Following this, the actual schedule needs to be printed. This is accomplished by means of a Report Query with associated Report Layout (XML with XSL/FO). The report runs perfectly and is nicely formatted, etc., but it opens as a PDF and not as a Apex report. The original interactive report, with checkboxes still ticked, stays open on the screen, and there is potential for error if the user clicks the "Schedule" button again. I therefore want to navigate away from the page - or reload the page (because the scheduled transactions will then no longer show in the interactive report) - to avoid this problem.
You can run Report queries from their URL ( f?p=&APP_ID.:0:&SESSION.:PRINT_REPORT=<REPORT NAME>)
So an approach would be to
On Button click, call a JS function that
<li>1. uses Ondemand/Callback process to do the workflow processing(check box selection records)
<li>2. opens the Report as a popup window(from your IR page)
<li>3. Redirect away from the IR page to another page?
<li>1. IR report submits the page
<li>2. In the PLSQL block you do the processing
<li>3. The branch redirects to a URL which would point to the Report URL.
<li>3. Have an onload JS which runs only when the request was the BUTTON request and that opens up a page which points to the report.
Yet another way would be to use htp.p within the PLSQL block that does the workflow processing
So your PLSQL code would be
BEGIN --Do the workflow processing here --End workflow processing htp.p('<script>'); htp.p(' window.open("f?p=&APP_ID.:0:&SESSION.:PRINT_REPORT=<REPORT NAME>"'); --opens up the PDF report htp.p(' window.location.href= "f?p=&APP_ID.:<page number>:&SESSION."'); --to redirect to new page htp.p('</script>'); END;