Search This Blog

Wednesday, May 22, 2019

Get Details Report by Clicking or Check on Interactive Grid Master Report

1. First create a interactive report on a table. Like select STD_ID, STD_NAME, ROLL_NO , CLASS_NAME from STUDENT_REG WHERE SECTION = :P57_SECTION AND UPPER(SCHOOL) = UPPER(:P0_SCHOOL_NAME) 2. Create a text field item like “P57_VAR” 3. Create a Dynamic Action on Event “Select Change Interactive Grid” and select respective selection type and region name. 4. Action > Execute JavaScript > var i, selectedIds=":" , model = this.data.model; for ( i = 0; i < this.data.selectedRecords.length; i++ ) { if (i>=0) { selectedIds += model.getValue( this.data.selectedRecords[i], "STD_ID") + ":"; } // ”STD_ID” is the unique key of the report else { selectedIds += model.getValue( this.data.selectedRecords[i], "STD_ID"); } } $s("P57_VAR", selectedIds); // "P57_VAR" is a item to preserve unique key to get another report data. apex.region("report").refresh(); // “report” is second report STATIC ID 5. Create report on same table with same condition. like select APEX_ITEM.display_and_save (03,STD_ID) STD_ID , STD_NAME, ROLL_NO , CLASS_NAME, --APEX_ITEM.CHECKBOX(02,'CHECKED','N') ATT_FLAG, APEX_ITEM.CHECKBOX(01,'#ROWNUM#','CHECKED') "Check" from STUDENT_REG where instr(:P57_VAR, ':' ||STD_ID|| ':' ) > 0 Now it may work… Maybe I can’t express the full cycle so try to understand your-self. Thank You.

1. First create a interactive report on a table. Like
select
    STD_ID,
    STD_NAME,
                ROLL_NO             ,
    CLASS_NAME
    from
    STUDENT_REG
WHERE    SECTION = :P57_SECTION
AND UPPER(SCHOOL) = UPPER(:P0_SCHOOL_NAME)

2. Create a text field item  like “P57_VAR”

3. Create a Dynamic Action on Event “Select Change Interactive Grid” and select respective selection type and region name.

4.  Action > Execute JavaScript >

var i, selectedIds=":" ,
    model = this.data.model;

for ( i = 0; i < this.data.selectedRecords.length; i++ ) {
    if (i>=0) {
    selectedIds += model.getValue( this.data.selectedRecords[i], "STD_ID") + ":"; } 

 // ”STD_ID” is the unique key of the report
    else
        {
    selectedIds += model.getValue( this.data.selectedRecords[i], "STD_ID");  
       }
}
$s("P57_VAR", selectedIds);

// "P57_VAR" is a item to preserve unique key to get another report data.

apex.region("report").refresh();

// “report” is second report STATIC ID

5. Create report on same table with same condition. like
select
    APEX_ITEM.display_and_save (03,STD_ID) STD_ID ,
    STD_NAME,
                ROLL_NO             ,
    CLASS_NAME,
    --APEX_ITEM.CHECKBOX(02,'CHECKED','N') ATT_FLAG,
    APEX_ITEM.CHECKBOX(01,'#ROWNUM#','CHECKED') "Check" 
  from
    STUDENT_REG
  where instr(:P57_VAR, ':' ||STD_ID|| ':' ) > 0

Now it may work…

Maybe I can’t express the full cycle so try to understand your-self.
Thank You.


No comments:

Post a Comment

Split A String By Coma (,)

Step 1.  create or replace type split_tbl as table of varchar2(32767); Step 2. create or replace function split (     p_list varchar2,...