This is used with a background report page that is fed details by the calling page and the report region is displayed in the current page with no page submit. I generally use it for a summary report, with a ‘Details’ column link that drills down to a further report with more info. The report’s actually in another page but is displayed on the same page with no refresh.
With this function you input the page number of your target report, the name of the div that you want it displayed in on the current page and then an array of the items (could include column substitutions etc.) on the current page and an array of the items of the target page that need to be populated.
Very flexible now – you can derive the target page and even where it should be displayed, not necessarily from static calls but even by item values (checkboxes, LOVs, whatever you want!).
You can see a little bit of rudimentary error handling in there that you can adapt if needed or simply remove – just there to throw things out to me when I was messing about with it.
Anyway, here’s a simple example using scott/tiger
So all I’ve done is create a
SELECT * FROM dept WHERE deptno = : P5_DEPTNO
report region on page 5. I’ve also added a Display As Text(does not save state) item called P5_DEPTNO. Display condition is ‘Never’.
Next, I’ve copied the Printer Friendly template and called it AJAX Report. Then I replaced the ‘Body’ definition in my new template with…
<ajax:TASTY_BODY> <div id="TASTY_BODY">#BOX_BODY#</div> </ajax:TASTY_BODY>
and associated page 5 with the new AJAX Report template.
This (page 5) is the background page.
Now on page 6, I have a
SELECT * FROM emp
I’ve also created a blank HTML region with a region source of…
<div id="my_div"> </div>
Then I’ve defined a ‘Department Details’ column with this as the link…
Note that the source items and target items are arrays – you can stick as many in there as you like, you can even target different pages and reports and display them in different regions on your page!