This discussion is archived
3 Replies Latest reply: Nov 15, 2012 1:51 AM by ryansun RSS

Suggestions to add checkbox to Report

ryansun Newbie
Currently Being Moderated
Version : 4.1.0

Hi There,

We have a classic report on an SQL. Now there is a requirement to add some sort of a check box against each report row where the user if selected, it marks that record as a favorite. That checkbox value will be stored in the table.

If it was a tabular form, I could have just added that as a checkbox and a DB column and it would get updated when the user hit the submit button, any suggesstions on how to do this on a report? Or the only way would be to convert the report to a tabular form ? Not sure, how to capture the Radio values. Any better suggestions are also welcome.

thanks,
Ryan
  • 1. Re: Suggestions to add checkbox to Report
    Jitendra Pro
    Currently Being Moderated
    Hi ryansun

    you can add checkbox to your report.

    Suppose this is your query report
    SELECT empno,
           ename,
           job
    FROM   emp
    you want to add checkbox to your report then try the below code
    SELECT APEX_ITEM.CHECKBOX(1,empno) " ",
           ename,
           job
    FROM   emp
    Click on report attributes then edit the checkbox column
    under column attributes
    set Display as = Standard Report Column


    For detail information follow the link given below
    http://docs.oracle.com/cd/E10513_01/doc/apirefs.310/e12855/apex_item.htm#CHDDCHAF


    Hope this will solve your problem.

    Regards,
    Jitendra
  • 2. Re: Suggestions to add checkbox to Report
    ryansun Newbie
    Currently Being Moderated
    Hi Jitendra,

    Thanks, In this to create the page submit process
    SELECT APEX_ITEM.CHECKBOX(1,empno) " ",
           ename,
           job
    FROM   emp
    ORDER  by 1
    Consider the following sample on-submit process:
    
    FOR I in 1..APEX_APPLICATION.G_F01.COUNT LOOP
        DELETE FROM emp WHERE empno = to_number(APEX_APPLICATION.G_F01(i));
    END LOOP;
    
    --------------------------------------------------------------------------------
    
     
    However, If I want to delete based on ename, do I need to convert that also into a APEX_ITEM first? For example if I want to

    DELETE FROM emp WHERE empno = to_number(APEX_APPLICATION.G_F01(i)) and ename = APEX_APPLICATION.GF02(i);


    I dont think that would work?

    Thanks,
    Ryan
  • 3. Re: Suggestions to add checkbox to Report
    ryansun Newbie
    Currently Being Moderated
    This is fixed. I had to change the report field to apex item

Legend

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