Home » Developer & Programmer » Application Express & MOD_PLSQL » Calling report from a interactive report page (Apex 3.2.1, Windows 7)
Calling report from a interactive report page [message #538538] Fri, 06 January 2012 14:02 Go to next message
tinkuvinay
Messages: 9
Registered: December 2011
Location: Dallas
Junior Member
Hi all,

I have application, where user can create a new record from a form page2. After the button "Create" is pressed the record is inserted and the page2 is redirected to the Interactive Report page1.

My requirement is, after the record is inserted, from the report page1 I want to go to another report page by clicking on a link which should be at row level. By clicking the link all the values of that record(row) must be passed to the required report page3.

How do I accomplish this?

Any suggestions please...
Re: Calling report from a interactive report page [message #538562 is a reply to message #538538] Sat, 07 January 2012 02:48 Go to previous messageGo to next message
Littlefoot
Messages: 19687
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
By clicking the link all the values of that record(row) must be passed to the required report page3.

I'm not sure I understand what you mean. A "report" is capable of displaying data stored within the database. Therefore, you write a SELECT statement and name all columns you need. If that's so, why do you need to "pass all values from interactive report to another report"? Is there any column (such as a primary key one) that can identify that record? I hope so! In that case, passing that single value would be quite enough.

Here's an example based on Scott's EMP and DEPT tables. My interactive report (your page1) displays values from the EMP table. There's a link on EMPNO column/item which calls another report (your page3) which displays values from the DEPT table. Link passes DEPTNO value.

OK then, here's how it goes: on a report (your page3; it is page8 in my application) create a hidden item: P8_PAGE_1_DEPTNO. Create a report whose query is
select deptno, dname, loc
from dept
where deptno = :P8_PAGE_1_DEPTNO

Go to interactive report page. Navigate to an item that will be used as a link column (EMPNO in my example). Make it link to another page in this application (page8 for me, page3 for you). Set name-value pair to P8_PAGE_1_DEPTNO = #DEPTNO# (i.e. when you click the link, item on page8 which is named P8_PAGE_1_DEPTNO will get value of DEPTNO in current record on the interactive report).

./fa/9699/0/

Run the interactive report. This is how it looks like; click any EMPNO (for example, Allen who works in department 30):

./fa/9700/0/

Another report will open and display department 30:

./fa/9701/0/

That would be all, I suppose.

As you can see, there are several name-value pairs when defining the link so, if necessary, use them.
Re: Calling report from a interactive report page [message #538813 is a reply to message #538562] Mon, 09 January 2012 10:15 Go to previous messageGo to next message
tinkuvinay
Messages: 9
Registered: December 2011
Location: Dallas
Junior Member
Hi,

In your example, you've created one hidden item and passing a value #DEPTNO# using the Name-Value pair.
In my application, I want to pass 13 values... But you said
Quote:
there are several name-value pairs when defining the link so, if necessary, use them.


I can see two more name-value pairs.
1. So, to accomplish my task, do I need another 12 hidden items?
2. How can I pass all the 12 hidden items like you said... since there are only 2 more left.
Re: Calling report from a interactive report page [message #538839 is a reply to message #538813] Mon, 09 January 2012 12:04 Go to previous messageGo to next message
Littlefoot
Messages: 19687
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As I said: your PAGE 3 report is supposed to display values that already exist in the database, so there's no sense in copying all these values, one by one, from one page to another. You should only know column(s) which will uniquely identify that record in a table. It is *usually* an ID, but could be a composite primary key as well. I don't know Apex that well, so yes - it seems that there are only 3 name-value pairs.

Page 3's SELECT statement should simply select values from that table having ID (or whatever it is) in its WHERE clause and ... well, display the output.
icon14.gif  Re: Calling report from a interactive report page [message #538983 is a reply to message #538839] Tue, 10 January 2012 11:11 Go to previous message
tinkuvinay
Messages: 9
Registered: December 2011
Location: Dallas
Junior Member
Thank you... you are awesome...
Previous Topic: Interactive report/Master-Detail form problem
Next Topic: Problem with a PL/SQL process...
Goto Forum:
  


Current Time: Tue Oct 21 15:26:04 CDT 2014

Total time taken to generate the page: 0.10906 seconds