Friday, 11 August 2017

Refresh detail report on selecting radio button.

Hello everyone,

This post is regarding the dynamically changing of the detail report based on the selecting the master record.

Below are the steps:
1. Create a below function on the page in function region.

function put_selected_value(sel_value) {
  $x('P1566_DTL_LINE_ID').value=sel_value;
}

2. Add Radio Button in the master query.
SELECT apex_item.radiogroup(
              p_idx            => 1
            , p_value          => LINE_ID
            , p_selected_value => :P1566_DTL_LINE_ID
            , p_display        => NULL
            , p_attributes     => 'class="empno"'
              ,p_onchange =>  'javascript:put_selected_value(this.value);'
)   radio_select, EMP_NO,EMP_NAME,DEP_NO,DEP_NAME FROM EMP_DEP_MAS

3. Create a dynamic action on change and selection type should be Jquery selector .empno
and in
action add below js code :

 $('#myReport1').trigger('apexrefresh');

4. Detail report query:

SELECT LINE_ID,DTL_LINE_ID, EMP_ADDRESS,EMP_EMAIL,DEP_ADDRESS,
DEP_MAIL FROM EMP_DEMP_DTL
WHERE DTL_LINE_ID=:P1566_DTL_LINE_ID

5. Pass the static id myReport1 in the detail report region which needs to be refreshed on selecting radio button.

6. Also, In detail report pass item in page item to submit P1566_DTL_LINE_ID.



Thank You!