Report with updateable checkbox

Here is what I want to do :
I have a report with a HTMLDB_ITEM.checkbox on a 'Y', 'N' field. I would like to be able to update that value by simply checking and unchecking my generated checkbox.
Example : select player_no, player_name, htmldb_item.checkbox(1,active,'N','Y') from players.
I would like to be able to uncheck the active checkbox and the field value for that player(using the player_no) would be updated to 'N' and vice versa when checking the box.
I had created a process that looped on my checkbox item like explained in the "how to", but only the check items were processed.
Then I tried adding the following to my select and looping on the second item, but both items do not follow each other. If I have 2 checkbox checked and 10 players, than the item 1(checkbox) has only 2 records compared to 10 for item 2(hidden player_no):
htmldb_item.checkbox(1,active,'N','Y')||htmldb_item.hidden(2,player_no)
Is my request feasible ?

Sorry, I used HTML tags to bold stuff, didn't realize that didn't work.
Sorry for the slow response, I have been swamped with work.
I am assuming everyone is using the htmldb_application.g_fxx(i) variables in PL/SQL processes when trying to process their checkboxes.
Here's an example that would be similar to Patrick's situation (above). This would be in the SQL for the report region:
htmldb_item.checkbox(1, player_no, decode(active, 'Y', 'CHECKED', null) || htmldb_item.hidden(2,player_no)
Let me explain why I'm doing this:
First: htmldb_item.checkbox(1, player_no, decode(active, 'Y', 'CHECKED', null) will create checkboxes. Rows with active = 'Y' would have a checked checkbox, but the value of the checkbox is the player_no. I would assume (and suggest) that player_no is a unique value for that record.
Second: htmldb_item.hidden(2,player_no) will be the item you wish to update. (I always make this the primary key or unique value, so I can update any data for that record, and it must be the same value as the checkbox value)
In the How To documents, they tell you to use this for processing checkboxes:
for i in 1..htmldb_application.g_f01.count
loop
--process here
end loop; where htmldb_application.g_f01 is your checkbox item.
I have noticed that it only counts the rows that have a checked checkbox. So if you have a report with 10 rows, and you've checked 2 checkboxes, the count for that item is only 2. Where as, the count for you hidden items is 10.
There are two ways I have made this process work, but here is probably the easiest way I would process all rows (rows with a checked checkbox and rows without the checkbox checked):
/*this will loop through every row of the report*/
for i in 1..htmldb_application.g_f02.count
loop
/*this will account for when they don't check any boxes*/
if htmldb_application.g_f01.count != 0
then
/*this will loop through the checked checkboxes*/
for k in 1..htmldb_application.g_f01.count
loop
/*this compares the values of player_no of the checkbox and hidden item*/
if htmldb_application.g_f01(k) = htmldb_application.g_f02(i)
then
--process where checkbox is checked
update xtable
set active = 'Y'
where player_no = htmldb_application.g_f02(i);
else
--process where checkbox is not checked
update xtable
set active = 'N'
where player_no = htmldb_application.g_f02(i);
end if;
end loop;
else
--same process where checkbox is not checked
update xtable
set active = 'N'
where player_no = htmldb_application.g_f02(i);
end if;
end loop;
Now I this is not exactly the same thing I have in my process, but this is extremely similar, so excuse any syntactical errors I have made.
Let me know if this helps. I realize when I post this, all the spacing I have to make the code easier to read is gone, so I would suggest spacing things in notepad for easier reading.
If you want to see how to use all the htmldb_item package items then you can be found them in the HTML DB documentation: https://cwisdb.cc.kuleuven.ac.be/ora10doc/appdev.101/b10992/mvl_api.htm#sthref1469

Similar Messages

  • Add new report with a checkbox form

    I’m trying to create a list with check boxes to add “contacts to a event”.
    I have my table contacts and events, when I create a event I should invite my contacts. I want to create a list with all my contacts with a checkbox option and populate a new table with all the assistance.
    I’m searching but I can’t find info.
    I hope you have some time thank you
    Rodrigo

    You can create a checkbox in your list with APEX_ITEM.CHECKBOX. There are quite a few examples to be found when you google, e.g.
    http://www.apex-blog.com/oracle-apex/adding-a-checkbox-to-your-report-apex_item-tutorial-30.html
    One time I just created a default tabular form with DELETE functionality, so the checkboxes were already in place. I just created another process instead of the normal MRU process. Went pretty well actually.

  • SQL Query updateable report with row selector. Update process.

    I have a SQL Query updateable report with the row selector(s).
    How would I identify the row selector in an update process on the page.
    I would like to update certain columns to a value of a select box on the page.
    Using the basic:
    UPDATE table_name
    SET column1=value
    WHERE some_column=some_value
    I would need to do:
    UPDATE table_name
    SET column1= :P1_select
    WHERE [row selector] = ?
    Now sure how to identify the [row selector] and/or validate it is checked.
    Thanks,
    Bob

    I don't have the apex_application.g_f01(i) referenced in the page source...In the page source you wouldn't find anything by that name
    Identify the tabular form's checkbox column in the page(firebug/chrome developer panel makes this easy)
    It should be like
    <input id="..." value="" type="checkbox" name="fXX" >we are interested in the name attribute , get that number (between 01 and 50)
    Replace that number in the code, for instance if it was f05 , the code would use
    apex_application.g_f05
    --i'th checked record' primary keyWhen you loop through a checkbox array, it only contains the rows which are checked and it is common practice to returns the record's primary key as the value of the checkbox(available as the the i'th array index as apex_application.g_f05(i) , where i is sequence position of the checked row) so that you can identify the record.

  • Report with Checkbox

    I am trying to follow the example shown at the below link but it is not working. I am modifying some of the code since I am using version 1.6. Any ideas as to what I may be doing wrong. The checkbox appears and I can select and deselect items but I cannot get P6_HOLDER to hold any of the values of the selected items. Thanks!
    http://apex-smb.blogspot.com/2009/01/apex-report-with-checkboxes-advanced.html
    First I created a page item called P6_HOLDER.
    Next I created a report region (sequence 40) with the below code.
    select htmldb_item.checkbox (1, dev_obj_id, 'onchange="spCheckChange(this);"',
    :P6_HOLDER, ':') checkbox, dev_id, dev_obj_desc from edm_dev_obj where
    dev_id = :P6_TEMP_DEV_ID
    **I then created a html region (sequence 1) with the below code**
    <SCRIPT src="http://www.google.com/jsapi"></SCRIPT>
    <SCRIPT>
    // Load jQuery
    google.load("jquery", "1.2.6", {uncompressed:true});
    function spCheckChange(pThis){
    var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=CHECKBOX_CHANGE',$v('pFlowStepId'));
    get.addParam('f01',pThis.value); //Value that was checked
    get.addParam('f02',pThis.checked ? 'Y':'N'); // Checked Flag
    gReturn = get.get();
    $f('checkListDisp').innerHTML=gReturn;
    </SCRIPT>
    CHECKBOX List:
    <DIV id=checkListDisp>&P6_HOLDER.</DIV>
    I then created an application process on Demand called CHECKBOX_CHANGE with the below code
    DECLARE
    v_item_val NUMBER := htmldb_application.g_f01;
    v_checked_flag VARCHAR2 (1) := htmldb_application.g_f02;
    BEGIN
    IF v_checked_flag = 'Y' THEN
    -- Add to the list
    IF :P6_HOLDER IS NULL THEN
    :P6_HOLDER := ':' || v_item_val || ':';
    ELSE
    :P6_HOLDER := :P6_HOLDER || v_item_val || ':';
    END IF;
    ELSE
    -- Remove from the list
    :P6_HOLDER := REPLACE (:P6_HOLDER, ':' || v_item_val || ':', ':');
    END IF;
    -- Just for testing
    HTP.p (:P6_HOLDER);
    END;

    Hi
    Create a page level validation (fucntion returning boolean) and write code similar to following
    DECLARE
    v_count NUMBER := 0;
    BEGIN
    FOR i IN 1..APEX_APPLICATION.G_F01.COUNT LOOP
    IF APEX_APPLICATION.G_F01(i) IS NOT NULL THEN
    v_count := v_count + 1;
    END IF;
    END LOOP;
    IF v_count = 0 THEN
    RETURN TRUE;
    ELSE
    RETURN FALSE;
    END IF;
    END;I take it your report query is similar to following
    select apex_item.checkbox(1,"PK_CLMN") Tick, col2, col3 FROM tbl_nameCheers,
    Hari

  • Setting fields defined in SQL updateable report with a process

    I have SQL statement defined in a SQL updateable report with hidden fields. I want to be able to update these hidden fields with values from other displayed fields on the page. How do I reference these hidden items - I have referencign them as :my_field but get and error telling me thats its underfined.

    But, the reason I am doing this is because I want to format the page with 6 columns in one <TD> cell with some extra text and formatting etc - I don't want 1 column per <TD>. Thats why I am using the APEX_ITEM.TEXT so I can format the 1 <TD> the way I want it (with 6 columns it there).
    In the short term can you tell me how to reference hidden fields please.
    I will create the case in apex.oracle.com in the next few days to make it clearer.
    P.S. see my previous post: SQL QUERY updateable report with APEX_ITEM fields to update hidden columns

  • Apex report performance is very poor with apex_item.checkbox row selector.

    Hi,
    I'm working on a report that includes some functionality to be able to select multiple records for further processing.
    The report is based on a view that contains a couple of hundred thousand records.
    When i make a selection from this view in sqlplus , the performance is acceptable but the apex report based on the same view performes very poorly.
    I've noticed that when i omit the apex_item.checkbox from my report query, performance is on par with sqlplus. (factor 10 or so quicker).
    Explain plan appears to be the same with or without checkbox function in the select.
    My query is:
    select apex_item.checkbox(1,tan_id) Select ,
    brt_id
    , tan_id
    , message_id
    , conversation_id
    , action
    , to_acn_code
    , information
    , brt_created
    , tan_created
    from (SELECT brt.id brt_id, -- view query
    MAX (TAN.id) tan_id,
    brt.message_id,
    brt.conversation_id,
    brt.action,
    TAN.to_acn_code,
    TAN.information,
    brt.created brt_created,
    TAN.created tan_created
    FROM (SELECT brt_id, id, to_acn_code, information, created
    FROM xxcjib_transactions
    WHERE tan_type = 'DELIVER' AND status = 'FINISHED') TAN,
    xxcjib_berichten brt
    WHERE brt.id = TAN.brt_id
    GROUP BY brt.id,
    brt.message_id,
    brt.conversation_id,
    brt.action,
    TAN.to_acn_code,
    TAN.information,
    brt.created,
    TAN.created)
    What could be the reason for the poor performance of the apex report?
    And is there another way to select multiple report records without the apex_item.checkbox function?
    I'm using apex 3.2 on oracle 10g database.
    Thanks,
    Niels Ingen Housz
    Edited by: user11986529 on 19-mrt-2010 4:06

    Thanks for your reply.
    Unfortunately changing the pagination doesnt make much of a difference in this case.
    Without the checkbox the query takes 2 seconds.
    With checkbox it takes well over 30 seconds.
    The second report region on this page based on another view seems to perform reasonably well with or without the checkbox.
    It has about the same number of records but with a different view query.
    There are also a couple of filter items in the where clause of the report queries (same for both reports) based on date and acn_code and both reports have a selectlist item displayed in their regions based on a simple lov. These filter items don't seem to be of influence on the performance.
    I have also recreated the report on a seperate page without any other page items or where clause and the same thing occurs.
    With the checkbox its very very slow (more like 20 times slower).
    Without it , the report performs well.
    And another thing, when i run the page with debug on i don't see the actual report query:
    0.08: show report
    0.08: determine column headings
    0.08: activate sort
    0.08: parse query as: APEX_CMA_ONT
    0.09: print column headings
    0.09: rows loop: 30 row(s)
    and then the region is displayed.
    I am using databaselinks in the views b.t.w
    Edited by: user11986529 on 19-mrt-2010 7:11

  • Creating TREE REPORT with CHECKBOX against each row

    Hi Friends,
    I need to create a <b>TREE REPORT with  CHECK BOX</b> against each row. when the user selects a row and clicks on a custom button then those should get populated into an internal table. <b>This is HIGH priority</b> one and I have tried my best but couldnt find any solution. Please advise me some sol.
    thanks in advance for your valuable time and help.
    Regards
    srithan
    Message edited by me for easyness
            Reddy

    Hi
    Following code is to add checkboxes in ALV tree:
    FORM add_root_request USING pls_data_ TYPE csg_gs_outtab_p_key__l_is_sub_node_ TYPE c
    CHANGING pl_carrid_key._node = nodes->add_node( related_node = p_key
    relationship = cl_gui_column_tree=>relat_last_child ).
    ... §0.2 if information should be displayed at
    the hierarchy column set the carrid as text for this node
    text = p_ls_data-object.
    node->set_text( text ).
    ... §0.3 set the data for the nes node
    node->set_data_row( p_ls_data ).
    item = node->get_hierarchy_item( ).
    item = node->get_item( 'FCHECKBOX' ). "FCHECKBOX is my radio button field in internal table which I am using to populate the ALV
    item->set_type( if_salv_c_item_type=>checkbox ).
    pl_carrid_key = node->get_key( )._
    CATCH cx_salv_msg.
    ENDFORM_._Following code is for handling checbox_change event
    PERFORM application_action_events.
    FORM application_action_events .
    data: lr_events type ref to cl_salv_events_tree.
    *data gr_events type ref to lcl_handle_events.
    lr_events = gr_tree->get_event( ).
    create object gr_events.
    set handler gr_events->check for lr_events.
    set handler gr_events->on_link_click for lr_events.
    set handler gr_events->on_before_user_command for lr_events.
    set handler gr_events->on_after_user_command for lr_events.
    set handler gr_events->on_keypress for lr_events.
    endform. " application_action_events----
    CLASS lcl_handle_events DEFINITION.
    PUBLIC SECTION.
    METHODS:
    check FOR EVENT checkbox_change OF cl_salv_events_tree IMPORTING node_key columnname checked. "Here node_key is the row number
    ENDCLASS. "lcl_handle_events DEFINITION
    CLASS lcl_handle_events IMPLEMENTATION
    §4.2 implement the events for handling the events of cl_salv_table
    CLASS lcl_handle_events IMPLEMENTATION_._
    METHOD check_._
    WRITE 'hello'_._
    DATA lwa_modify_check_ TYPE REF TO csg_gs_outtab.
    node_key = node_key - 1_._
    READ TABLE csg_gt_list INDEX node_key REFERENCE INTO lwa_modify_check._
    if columnname = 'FCHECKBOX'_._
    IF checked = 'X'_._
    If the value in internal table is set to X, then it is deselct
    lwa_modify_check->fcheckbox =_ ' '_._
    ELSE_._
    lwa_modify_check->fcheckbox =_ 'X'_._
    ENDIF_._
    ENDIF_._
    if columnname = 'CHECKBOX_READ'_._
    IF checked = 'X'_._
    If the value in internal table is set to X, then it is deselct
    lwa_modify_check->checkbox_read =_ ' '_._
    ELSE_._
    lwa_modify_check->checkbox_read =_ 'X'_._
    ENDIF_._
    ENDIF_._
    *MODIFY TABLE csg_gt_list from l_wa_modify_check.
    flag_test = flag_test + 1_._
    ENDMETHOD_._ "check
    ENDCLASS_._ "lcl_handle_events IMPLEMENTATION
    Please give me reward points

  • Issue with APEX_ITEM.CHECKBOX in Manual Tabular Form report

    Hi,
    I have a simple manual tabular form report with query :
    SELECT
    APEX_ITEM.CHECKBOX(1,order_id) ,
    APEX_ITEM.TEXT(3,Ord_number) ,
    APEX_ITEM.TEXT(4,ord_flag)
    from
    tbl_order
    and a process to update the value of Ord_number & ord_flag columns for the selected (Checked) rows.
    FOR i in 1..apex_application.g_f01.count
    loop
    UPDATE
    tbl_order
    SET
    Ord_number = apex_application.g_f03(i),
    ord_flag = apex_application.g_f04(i)
    WHERE
    order_id = apex_application.g_f01(i);
    END LOOP;
    But the values getting updated wrongly , how can I ensure the exact values is retrieved in apex_application.g_f03(i) & apex_application.g_f04(i) ?
    Regards.
    Benz

    I think the row selector is there if you create an tabular form. However, you can create it yourself following this example:
    http://apex.oracle.com/pls/otn/f?p=31517:170
    Basically,
    apex_item.checkbox (30,
                               '#ROWNUM#',
                               'onclick="highlight_row(this,' || ROWNUM || ')"',
                               NULL,
                               'f30_' || LPAD (ROWNUM, 4, '0')
                              ) delete_checkboxDenes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Report with checkboxes

    Hi all,
    I have a report with checkboxes getting the empno in return
    I have
    select apex_item.checkbox(1, empno) cbox,a.empno, a.ename,a.mgr,a.deptno from emp a
    in the report....
    I do have a dummy hidden field(P2_EMPNOS) which stores the empno's into it with comma concatenated(for which i wrote a page process)
    DECLARE
    vRow BINARY_INTEGER;
    BEGIN
    :P2_EMPNOS := NULL;
    :P2_EMPNOS :=apex_application.g_f01(1);
    FOR i IN 2 .. apex_application.g_f01.COUNT
    LOOP
    :P2_EMPNUMS :=
    :P2_EMPNOS
    || ','
    || apex_application.g_f01(i);
    END LOOP;
    END;
    in my next page I want the records that I have selected like this
    select a.empno, a.ename,a.mgr,a.deptno
    from emp a
    where empno in :P2_EMPNOS
    I did tried (:P2_EMPNOS),':P2_EMPNOS'
    The problem is if I select one checkbox, then in the next page I'm getting that one record....
    but If I select multiple, then starts trouble...it says "no data found"...but still the values can be viewed in the next page with comma separated
    Can some body help me in this please.
    Thanks in advance.
    Gora

    Hello Varad,
    Thankyou for the quick response.
    The problem here is....my item is getting the selected values as a string(i guess ;) )
    i think we have to figure out how we could break it and send those as single values.
    Any more guesses please...
    Regards,
    Gora

  • Report with checkbox and collection

    Hi all
    I need to manage an interactive report to filtering and selecting rows by checkboxes and then use a collection to manage the selected records.
    I used a first collection to create the source record set by a On-Load Before-Header Process:
    DECLARE
    v_id NUMBER;
    var1 Varchar2(8);
    var2 Varchar2(10);
    var3 VARCHAR2(50);
    var4 VARCHAR2(10);
    var5 VARCHAR2(100);
    var6 VARCHAR2(5);
    cursor c_Populate is
    SELECT
    dep.chassis_code AS chassis_code,
    dep.model_code AS model_code,
    m.model_description AS model_description,
    dep.acc_doc_number AS acc_doc_number,
    dest.description AS destination_descr,
    (trunc(sysdate) - dep.entry_date) Anzianita
    FROM deposit_chassis dep, warehouses w, warehouse_map map, models m, site s,
    destinations dest, T_SUB_DESTIN_DEALERS sdd
    WHERE
    dep.status = 5 AND
    w.ware_code = map.ware_code AND
    dep.DEALER_CODE = sdd.DELIVERY_POINT AND
    dep.DESTINATION_CODE = sdd.DESTINATION_CODE AND
    map.map_code = dep.map_code AND
    m.model_code = dep.model_code AND
    DEP.UNLOADING_SITE = S.SITE_CODE AND
    DEP.destination_code = dest.destination_code And
    dep.unloading_site = 'S0000074' and w.site_code = 'S0000074';
    i NUMBER;
    BEGIN
    APEX_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION(p_collection_name => 'MY_COLLECTION');
    OPEN c_Populate;
    LOOP
    FETCH c_Populate into var1, var2, var3, var4, var5, var6;
    EXIT WHEN c_Populate%NOTFOUND;
    APEX_COLLECTION.ADD_MEMBER(
    p_collection_name => 'MY_COLLECTION',
    p_c001 => var1,
    p_c002 => var2,
    p_c003 => var3,
    p_c004 => var4,
    p_c005 => var5,
    p_c006 => var6);
    END LOOP;
    CLOSE c_Populate;
    END;
    Then I created a region for a SQL report:
    SELECT
    APEX_ITEM.CHECKBOX(1,c001) Chk,
    apex_item.text(2, c001) Telaio,
    apex_item.text(3, c002) ModelCode,
    apex_item.text(4, c003) Model,
    apex_item.text(5, c004) Doc_Number,
    apex_item.text(6, c005) Destination,
    apex_item.text(7, c006) Age
    FROM APEX_COLLECTIONS
    WHERE COLLECTION_NAME = 'MY_COLLECTION';
    Then, with a submit button and the relative process (below), I need to load a new collection for further elaboration.
    How can I obtain the single values for each field of my selected row (see MY_COLLECTION) ?
    APEX_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION(p_collection_name => 'COL_AVAILABLE_CHASSIS');
    FOR i IN 1..APEX_APPLICATION.G_F01.Count
    LOOP
    APEX_COLLECTION.ADD_MEMBER(
    p_collection_name => 'COL_AVAILABLE_CHASSIS',
    p_c001 => I need the Telaio
    p_c002 => I need the ModelCode
    p_c003 => I need the Model
    p_c004 => I need the Doc_Number
    p_c005 => I need the Destination
    p_c006 => I need the Age
    END LOOP;
    Thanks in advance,
    Massimo

    Dear Jari
    I've looked at your sample.
    Yes it seems ok for my apps
    So, i've done the following update to my code:
    Souce Report
    SELECT
         APEX_ITEM.CHECKBOX(3,c001) Chk,
         APEX_ITEM.TEXT(4,c001) Telaio,
         APEX_ITEM.TEXT(5,c002) ModelCode,
         APEX_ITEM.TEXT(6,c003) Model,
         APEX_ITEM.TEXT(7,c004) Doc_Number,
         APEX_ITEM.TEXT(8,c005) Destination,
         APEX_ITEM.TEXT(9,c006) Anzianita
    FROM APEX_COLLECTIONS
    WHERE COLLECTION_NAME = 'MY_COLLECTION'
    The Submit Process
    DECLARE
      l_row NUMBER := 1;
    BEGIN
      FOR i IN 1..APEX_APPLICATION.G_F03.COUNT
      LOOP
        FOR j IN l_row..APEX_APPLICATION.G_F04.COUNT
        LOOP
          IF APEX_APPLICATION.G_F04(j) = APEX_APPLICATION.G_F03(i) THEN
              -- ONLY FOR TEST PURPOSE --
            htp.p('Telaio: '||APEX_APPLICATION.G_F03(i));
            htp.p('Campo: ' ||APEX_APPLICATION.G_F04(j));
            htp.p('Campo: ' ||APEX_APPLICATION.G_F05(j));
            htp.p('Campo: ' ||APEX_APPLICATION.G_F06(j));
            htp.p('Campo: ' ||APEX_APPLICATION.G_F07(j));
            htp.p('Campo: ' ||APEX_APPLICATION.G_F08(j));
            htp.p('Campo: ' ||APEX_APPLICATION.G_F09(j));
            l_row := j + 1;
            EXIT;
          END IF;
        END LOOP;
      END LOOP;
      COMMIT;
    END;
    Is it correct to manage G_F0x like my code ?
    Thanks,
    Massimo

  • Report with checkbox to PDF-File with BI Publisher

    Hello,
    I am able to create reports in APEX to create PDF-Files. We are using the BI Publisher.
    Now we have to design a rft-Template with a checkbox. In BI Publisher it works with the checkbox greate, but if I create in APEX report and a layout the checkbox is not display in the PDF-File.
    Does anyone has a solution for that?
    Regards,
    Mark

    I have a same issue ...
    How you are calling a bi report from apex....?
    Please help me...
    ty

  • Filter report with checkbox

    I have a report (select A, B, C from TABLE1) on PAGE1
    I also added a little form on PAGE1. this form contains a list of checkbox generated dynamically with another query.
    I would like to filter my report with the values of the checked items in the form (so we get something like that : select A, B, C from TABLE1 where A in (checkbox1, checkbox4))
    Im using Apex 4
    Any idea how to achieve this ?
    thanks

    Hello quiqui42,
    You haven't given enough specific information about your situation, so I'll have to make some assumptions.
    I'm assuming that by "this form contains a list of checkbox generated dynamically with another query", you mean that you have a checkbox item that is based on a dynamic LOV. If this is the case, let's pretend that if checkbox 1 and checkbox 4 are checked, the value of the checkbox item (let's call it P1_FILTER) is "1:4".
    Now, there's probably lots of ways to do what you need to do, but I'll give you two. One is very easy, but could come at the cost of performance; the other is a little more involved but will execute much better on a large table, as long as what you're filtering on is indexed.
    Easy but potentially slow one:
    SELECT   a, b, c
      FROM   table1
    WHERE   INSTR(':' || :P1_FILTER || ':', ':' || a || ':') > 0;This could be a performance dog because it will not matter if column "a" is indexed - since you're running it thru a function the database will not use the index. Depending on the size of this table, this may or may not be a concern.
    Here is the more involved but better-performing one:
    1) Create a type:
    CREATE TYPE filter_vals AS TABLE OF VARCHAR2(10);      // replace varchar2(10) based on the size/type of your filter values2) Create a function:
    CREATE FUNCTION get_filter_vals(vals IN VARCHAR2)
       RETURN filter_vals
       PIPELINED
    IS
       arr  apex_application_global.vc_arr2 := apex_util.string_to_table(vals);
    BEGIN
       FOR i IN 1 .. arr.COUNT LOOP
          PIPE ROW (arr(i));
       END LOOP;
       RETURN;
    END get_filter_vals;3) Put this in the SQL for your report:
    SELECT   a, b, c
      FROM   table1
    WHERE   a IN (SELECT   COLUMN_VALUE FROM table(get_filter_vals(:P1_FILTER)));Step 1 creates a table type that is used by the function created in step 2. Step 2 is a pipelined function that turns a colon-delimited string (such as what is typically held in a list of checkboxes based on an LOV) into something that can be select-ed on just like a table. Finally, step 3 shows the query that uses the function in a way that allows a where-in clause, which will take advantage of an index on column "a" in a large table.
    Hope this helps,
    John

  • Issues with report with checkbox

    Hi friends,
    i have created a report with checkbox.
    the query is
    > select apex_item.checkbox(1,person_id,'unchecked') "select",
    person_id,
    AVAIL_SAL_CERTIFICATE,
    OCCURANCE,
    LAST_AVAILED_DATE,
    REASON,
    EFFECTIVE_START_DATE,
    EFFECTIVE_END_DATE
    from YY_SALARY_CERTIFICATEnow am having one button in my report region. suppose if i checked the particular row in report and clicked that button it should redirect to next page which is a form page it contains all the fields what report page had and it should display the value of corresponding report row which i checked.
    how i can achevie this?
    pls someone help me...

    <li>On Submit PLSQL
    DECLARE
      lc_colln_name VARCHAr2(100) := 'MY_COLLN';
    BEGIN
      APEX_COLLECTION.CREATE_COLLECTION(lc_colln_name);
    FOR i IN 1..APEX_APPLICATION.G_F01.COUNT --use the checkboxes array index used in query
    LOOP
       --Add each checked record id to collection
       APEX_COLLECTION.ADD_MEMBER
                p_collection_name => lc_colln_name
               ,p_c001 => APEX_APPLICATION.G_F01(i)  --Now c001 column of collection has this id
    END LOOP;
    END;<li>SQL Query of report in Page 2
    select person_id,
    AVAIL_SAL_CERTIFICATE,
    OCCURANCE,
    LAST_AVAILED_DATE,
    REASON,
    EFFECTIVE_START_DATE,
    EFFECTIVE_END_DATE
    from YY_SALARY_CERTIFICATE
             ,apex_collections AC
    where AC.collection_name = 'MY_COLLN' --use the name of the collection created previously
    AND    person_id = AC.c001

  • Create a report with PL/SQL

    Hi,
    I have two pages: the first page contains two text fields and a submit button. In the first text field you can enter a name and in the second field you can enter a number. That means you can search a record by name or by number.
    In the second page the report is generated depending on the used text field of the first page.
    I tried to to define a region source code with PL/SQL for the report, but nothing appears on the report page although the record I was looking for exists in the database.
    begin
    if :ENTERNAME IS NOT NULL then
    FOR item IN (select "TB_PERSON_INSTITUTION"."PI_ID" as "PI_ID",
    "TB_PERSON_INSTITUTION"."PI_NAME" as "PI_NAME",
    "TB_PERSON_INSTITUTION"."PI_VORNAME" as "PI_VORNAME",
    from     "TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
    where      upper("TB_PERSON_INSTITUTION"."PI_NAME") like upper(:ENTERNAME||'%'))
    loop
    DBMS_OUTPUT.PUT_LINE('First name = ' || item.PI_NAME ||
    ', Last name = ' || item.PI_VORNAME);
    end loop;
    end if;
    end;
    Regards
    Mark

    Hi,
    ok thanks. I tried to use the SQL-Report with type "SQL Query (PL/SQL function body returning SQL-Query)" and made a few changes in the SQL-Statement so that a second table is also included:
    declare My_select varchar2(500);
    begin
    if :TEXTEINGABENAME IS NOT NULL then
    My_select:='SELECT
    "TB_ADRESSE"."A_PLZ" "A_PLZ",
    "TB_ADRESSE"."A_ORT" "A_ORT",
    "TB_ADRESSE"."A_ID" "A_ID",
    "TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER" "PI_MITGLIEDSNUMMER",
    "TB_PERSON_INSTITUTION"."PI_NAME" "PI_NAME",
    "TB_PERSON_INSTITUTION"."PI_VORNAME" "PI_VORNAME",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG" "PI_ERGAENZUNG",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG1" "PI_ERGAENZUNG1",
    "TB_PERSON_INSTITUTION"."PI_ID" "PI_ID"
    FROM
    "TB_ADRESSE" "TB_ADRESSE",
    "TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
    WHERE "TB_PERSON_INSTITUTION"."PI_ID" = "TB_ADRESSE"."A_F_PERSON_INSTITUTION"
    AND upper("TB_PERSON_INSTITUTION"."PI_NAME") like upper(:TEXTEINGABENAME||"%")';
    else
    if :TEXTMITGLIEDSNUMMER is not null then
    My_select:='SELECT
    "TB_ADRESSE"."A_PLZ" "A_PLZ",
    "TB_ADRESSE"."A_ORT" "A_ORT",
    "TB_ADRESSE"."A_ID" "A_ID",
    "TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER" "PI_MITGLIEDSNUMMER",
    "TB_PERSON_INSTITUTION"."PI_NAME" "PI_NAME",
    "TB_PERSON_INSTITUTION"."PI_VORNAME" "PI_VORNAME",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG" "PI_ERGAENZUNG",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG1" "PI_ERGAENZUNG1",
    "TB_PERSON_INSTITUTION"."PI_ID" "PI_ID"
    FROM
    "TB_ADRESSE" "TB_ADRESSE",
    "TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
    WHERE "TB_PERSON_INSTITUTION"."PI_ID" = "TB_ADRESSE"."A_F_PERSON_INSTITUTION"
    AND upper("TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER") like upper(:TEXTMITGLIEDSNUMMER||"%")';
    end if;
    end if;
    return My_select;
    end;
    When I try to apply changes an error message occurs:
    "Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. The query can not be parsed, the cursor is not yet open or a function returning a SQL query returned without a value."
    Regards,
    Mark

  • Aggregrate function in report with group by

    I have SQL report with all the records and Total of some of the fields in end.
    I wanted to group them by item1 and than show the Total for the fields for each Item

    In your report have a break formatting section, select the column you wish to break (sub-total on).. make sur eto set the sum checkbox on the column you ar edoing the break on too! It will then build the sub-total line for you..
    Thank you,
    Tony Miller
    Webster, TX
    Never argue with an idiot. They drag you down to their level, then beat you with experience.
    If this question is answered, please mark the thread as closed and assign points where earned..

Maybe you are looking for

  • My I pad original cannot connect to I tunes store even though connects to web . .

    My I pad original will not connect to the I tunes store even through it connects to the web . ?

  • JButton in JTable

    Hello all ! I want to create a JTable with Cell (class that I will write which extends JButton) in each cell of the table. Cell should contain a state, say 0,1,2 or 3, which dictates the representation of the cell. A representation of a cell contains

  • Reporting on Exchange 2007 DB Growth

    Hi I'm running a report on a new SCOM2012 installation for Exchange 2007 DB File Growth via the Reporting page in SCOM. However, I get no data back at all. Just the summary page entitled Performance Report. I can select my MDB's OK when setting up th

  • Can objects be passed between Applets and JSP?

    Can objects be passed between Applets and JSP? If so how? Thanks in advance. Scott

  • Error during INDEX creation

    Hi , I am trying to create Index on table D010TAB but it is giving error "Indexes Z1 and 0 for table D010TAB have identical fields". When I tried to search for Index 0, I did not find it. does the table have default index as 0 assigned? Regards, Saur