Wednesday 19 February 2014

Two Interactive Reports on one Page

Within APEX you normally can't define two Interactive Reports on the same page. But sometimes you do need that kind of solution. You can use Ajax to get the data into your form, but using an IFrame seems a more elegant way. There are some drawbacks using IFrame but "every advantage has it's disadvantage".

But this is how it works using an IFrame:

1. Create a page (ex. 24) with an Interactive Report on DEMO_ORDER_ITEMS - set the Page Template to 'Printer Friendly' to get rid of the regular header and footer stuff.
2. Create a page (ex. 23) with an Interactive Report on DEMO_ORDERS
3. On page 23 create an HTML Region with as Region Source:

  <IFRAME src="f?p=&APP_ID.:24:&SESSION."
  style="width:600px;height:600px"
  name="details"
  scrolling="no" marginwidth="0" marginheight="0"
  frameborder="0" vspace="0" hspace="0"  /> 
 
4. Set the Link Column attributes of the Interactive Report on DEMO_ORDERS to:
- Link Column : Custom Target
- Link Attributes : target="details" (that's the name of the IFRAME)
- Target Page : 24
- Clear Cache : 24,RIR (will clear the IR cache on Page 24)
- Item 1 : IR_ORDER_ID as the Name, #ORDER_ID# as the Value (will set ORDER_ID as Search Item.


Now if you click on the Column Link on the left IR, the right IR gets synchronized. Isn't that cool?
See the live example on apex.oracle.com.

Example:-

Steps to create multiple IR on same page:-

1) Create page 1 with an Interactive Report.
2) Create page 2 with another Interactive Report.
3) Create page 3.
  • Add 2 HTML Region , one for each IR.
  • Edit the first HTML Region. Go to Source Tab and add the below code

    <iframe src ="f?p=&APP_ID.:1:&SESSION." height=600 width=600 frameborder=0>
    </iframe>

  • Edit the second HTML Region.Go to Source Tab and add the below code.

    <iframe src ="f?p=&APP_ID.:2:&SESSION." height=600 width=600 frameborde
    </iframe>

2 comments:

  1. hi as i had created the tabular form in the report but i was unable to update or add new row to the table.is there any other solution can u guide me
    thaking you (Gopichandbuddi111@gmail.com

    ReplyDelete
  2. Hi Elegovan...this post is a copy of this one (link below). Why don't you mentioned it?!

    http://roelhartman.blogspot.com.br/2009/03/two-interactive-reports-on-one-page.html

    ReplyDelete