This discussion is archived
2 Replies Latest reply: Jul 11, 2013 11:00 PM by 19SeGro93 RSS

Report ID for different Applications

19SeGro93 Newbie
Currently Being Moderated

Hi,

I have a javascript code, which refreshes a report on a page.

The problem is, that the report ID is hard coded. If I import this page to a different application, the report woun't be refreshed anymore.

Following code is used:

[...]

var v_get = new htmldb_Get(null, $v('pFlowId'),   'APPLICATION_PROCESS=AP_RECALC', 0);

v_get.addParam('x01', Segment);

v_Return = v_get.get();

 

$a_report('734879922768742332', '1', '5000', '5000');

[...]

 

Is there a possibility to change the '734879922768742332' to a variable, constant or static id (which does not cause a endless loop)

 

Thanks for your help

 

Remark: If you know the answer, you will get the points

  • 1. Re: Report ID for different Applications
    vdsadhi Journeyer
    Currently Being Moderated

    Hi

     

    I had the same problem long back. I used hidden item to solve this issue. You can create a hidden item on the page as below

     

    Source Type: SQL Query (return single value)

    Source:

    select to_char(region_id)

    from apex_application_page_regions

    where application_id = :APP_ID

    and page_id = :APP_PAGE_ID

    and upper(region_name) = upper('TEST REGION') //TEST REGION- Name of your region.

    change your javascript  as per your requirement for example,

     

    var reg_id=$v('P1_REGION_ID');

    $a_report(reg_id,'1','15','15');

     

    It will work.

     

     

    Thanks

    Lakshmi

  • 2. Re: Report ID for different Applications
    19SeGro93 Newbie
    Currently Being Moderated

    You are right.

    Thank you

     

    I created the hidden item and changed the code from:

    $a_report('734879922768742332', '1', '5000', '5000');

     

    To: 

    $a_report($v(

    'P6_REPORT_ROUTE_ID'), '1', '5000', '5000');//734879922768742332

     

    That's it.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points