Generate Report based on Select List

Hi ,
I have a drop down list those are the column names and a corresponding value i will enter in input text . so based on these two values how can i generate a report in Apex i am using apex 4.0.2.
Means in where clause dropdown value will become column name and input text will become value for that column;
Thanks
Raghav

This gets complicated really fast.
I'd use an Interactive Report.
select * from emp
where (:P5_COLUMN_NAME='deptno' and deptno= :P5_COLUMN_VALUE)
   or (:P5_COLUMN_NAME='ename' and ename= :P5_COLUMN_VALUE)

Similar Messages

  • Refresh classic report based on select list value selected

    hello,
    can anyone please help me out with this issue. I have a parameterized classic report based on a select list and I want to refresh this report whenever the select list value is changed. I am using oracle apex version 3.2. i just want to have a javascript function onchange event for the select list which refreshes my report whenever a value is selected.
    My select list item is p1_datastore
    select distinct datastore d,datastore r from my_table1 order by 1;
    My classic report query is
    select * from my_table2 where datastore = :p1_datastore order by last_updated_dt desc;
    ****************************************************thanks,
    orton

    can anyone please help me out with this issue.
    thanks,
    orton

  • Report displayed based on Select List condition

    Hello,
    Any help would be appreciated.
    I have a report and a select list, P55_MISSING. The select list contains the column names in the table that the report displays.
    If I select one of the column names, I would like to display all records where that column name is null.
    The sql I have at the moment is:
    select
    "ID",
    "APPLICATION",
    "SHORT_DESCRIPTION",
    "DESCRIPTION",
    "OPC_NET_NAMES",
    "PROCESSING_SCHEDULE",
    "PROCESSING_REGULARITY",
    "PLATFORMS_INVOLVED",
    "UNIX_DIRECTORIES",
    "SOURCE_FILES",
    from "APP_METADATA"
    where :P55_MISSING IS NULL
    If I select 'source files' for example, I would expect to see 3 out of 4 records stored in the table. However, I receive the message 'no data found'.
    Any help would be great. Thank you.

    Hi
    In order to doe this you will have to use dynamic sql (so you have to change your report type to 'SQL Query (PL/SQL Function Body Returning SQL Query)').
    It would then look something like this...
    DECLARE
    l_sql VARCHAR2(32767);
    BEGIN
    l_sql := 'SELECT id,
                     application,
                     short_description,
                     description,
                     opc_net_names,
                     processing_schedule,
                     processing_regularity,
                     platforms_involved,
                     unix_directories,
                     source_file
              FROM   app_metadata
              WHERE ';
    l_sql := l_sql||:P55_MISSING||' IS NULL';
    RETURN l_sql;
    END;Sorry, I can't test this as I don't have your tables.
    Cheers
    Ben

  • Chart based on Select list with submit Lov problem

    Hi,
    I have one page with interactive report showing username with links, date and
    database actions.
    Another page contains one region having flash chart based on select list with submit Lov.
    The lov is created by dynamic query.
    Every time when i click the 1st page report link, the 2nd page lov is populating the value automatically. But the problem is chart displays NO DATA FOUND message though the LOV has many values.
    I don't want to display any null values so set to NO for LOV
    I tried to write Before header computation (PL/SQL Function Body) to set the lov value, but the query is displayed as such.
    I don't want to assign any static default value also as the values are dynamic for every link.
    The following is my Before header computation of Select list with submit (Item name is p11_schema). (PLSQL Function Body)
    begin
    if :p11_schema is null then
    return 'select distinct owner schema1, owner schema2 from auditing
    where access_date=' || :p11_access_date
    || ' and username=' || :p11_username
    || ' order by owner';
    end if;
    end;
    This is my chart query.
    select null link, obj_name label, sum(sel_count) "Select", sum(ins_count) "Insert", sum(upd_count) "Update", sum(del_count) "Delete" from auditing
    where username=:p11_username
    and access_date=:p11_access_date
    and owner=NVL(:p11_schema, OWNER)
    group by owner, obj_name
    Example: If there more than one records in the lov, the graph should display the 1st record. When i select another record, the chart accordingly display the selected values. But inially it should not display "NO DATA FOUND" message.
    I tried using all the combinations of computation type for the lov, SQL query ( I could not use if conditon then), PLSQL expression, PLSQL function body. But it does not work out.
    Can anyone please help me out.
    Thanks.

    Hi Scott,
    Thanks for your reply.
    I found out the solution for this problem as below.
    But i did it in different way to tackle the dynamic query wich returns more than one record using rownum always the 1st record when it is empty instead of assigning constant (static) value like '1'. And i am returning LOV itself for both null or not null condition as below.
    Declare
    q varchar2(4000);
    begin
    if :p11_schema is null then
    q:='select distinct owner schema from auditing';
    q:=q || ' where username=:p11_username ';
    q:=q || ' and access_date=:p11_access_date ';
    q:=q || ' and rownum<2 order by owner';
    Execute immediate q into :p11_schema USING :p11_username, :p11_access_date;
    end if;
    return :P11_SCHEMA;
    end;
    Thanks.

  • How to create a report  based on selected item from Select list?

    Hi,
    I have created a tables_LOV based on:
    select table_name d, table_name r from user_tab_cols
    where column_name like '%_type%'
    Then I created a page item ListOfTables,  Display as select list and pointing to tables_LOV.
    I run the page, and i can select the table i want from the drop down list.
    How to create a report  based on the selected item? (ex: select * from selected_table)
    many thanks in advance
    Salah

    Hi Salah,
    Allright, have a look at this page: http://apex.oracle.com/pls/apex/f?p=vincentdeelen:collection_report
    I think that simulates what you're trying to accomplish. I've set up the simplest method I could think of.
    The report is based on an apex collection. If you are not familiar with that, you should study the documentation: APEX_COLLECTION
    To recreate my example you should:
    1) create an (interactive) report on your collection
    SELECT *
       FROM APEX_collections
    WHERE collection_name = 'MY_COLLECTION'
    2) create a page_item select list for the tables you want to display (in my case this is called "P38_TABLES" )
    3) create a dynamic action that triggers on change of your select list page_item. The dynamic action must be a PL/SQL procedure perfoming the following code:
    declare
      l_query varchar2(4000);
    begin
      l_query := 'select * from '||:P38_TABLES;
      if apex_collection.collection_exists
            ( p_collection_name => 'MY_COLLECTION' )
      then
        apex_collection.delete_collection
          ( p_collection_name => 'MY_COLLECTION' );
      end if;
      apex_collection.create_collection_from_query
        ( p_collection_name => 'MY_COLLECTION'
        , p_query           => l_query
    end;
    Make sure you add your page_item to the "Page Items to Submit" section.
    4) Add an extra true action that does a refresh of the report region.
    Here are two pictures describing the da:
    http://www.vincentdeelen.com/images/otn/OTN_COLLECTION_REPORT_DA1.png
    http://www.vincentdeelen.com/images/otn/OTN_COLLECTION_REPORT_DA2.png
    Good luck and regards,
    Vincent
    http://vincentdeelen.blogspot.com

  • Report -- filter with selection list -- show all values after select page

    Hello!
    I have the following problem:
    - I have a report
    - this report can be filtered with a selection-list
    - the selection list is based on dynamic LOV and has a null-value
    - I added the code of the report the following, to filter the report after choosing a value of the selection list:
    ... and (instr(type, decode(:P8_FILTER_type, '%null%',type,:P8_FILTER_type)) > 0)
    This works very well.
    But my problem is: When the user logs out and the next time, he logs in, the selection list shows " --- show all values --- " (my null-display-value) and the report is empty "no values found".
    ---> I want to show the first time, the page is selected ALL the values of the report. (this is now only possile if I press the button which belongs to the selection list)
    I hope, somebody understands my problem.
    Thank you so much,
    LISA

    Hello Lisa,
    The first time it's probably NULL.
    So what you can do in your where: (instr(type, decode(NVL(:P8_FILTER_type,'%null%'), '%null%',type,:P8_FILTER_type)) > 0)
    Off topic: I also wonder if that where clause can't be simpler? Do you rely need the instr?
    Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/
    http://www.apexblogs.info/

  • Is there an easier way to get tabular report results with select lists?

    Ok, as a newbie, I have gotten this query to work in my report region but I figure if I am doing something this convoluted then I am not letting a wonderful feature of HTML DB do its job.
    I have 3 select lists that I want to "AND" together to filter the result list. Two of the selected items to filter could have null values.
    I want to have the entire results to appear when the list is reset (clear cache is working and sets each select list value to null). However, it appears to me, if one select list is used and the others are not, the other select lists by default have %null% (Null return value setting left blank) which isn't really null.
    Well if that wasn't confusing so far. Here is the select:
    select [my columns]
    from my_table
    where (instr(upper("COL1"),upper(
    decode(:P1_FILTER_COL1,'%null%',"COL1",
    null,"COL1",:P1_FILTER_COL1))) > 0 -- COL1 is mandatory
    AND
    (instr(upper("COL2"),upper(
    decode(:P1_FILTER_COL2,'%null%',"COL2",
    null,"COL2",:P1_FILTER_COL2))) > 0 OR "COL2" IS NULL)
    AND
    (instr(upper("COL3"),upper(
    decode(:P1_FILTER_COL3,'%null%',"COL3",
    null,"COL3",:P1_FILTER_COL3))) = 1 OR "COL3" IS NULL)
    Do I have to use decode for the select values being reset, selected/not selected? Is there some way for the Null return value setting to really be null not %null%?
    Thanks,
    Kelly

    Rather than creating your report directly from a SQL statement use the "Sql Query (PL/SQL Function Body returning Sql Query)" option and re-write your code in PL/SQL. PL/SQL gives you greater control and allows you to test the "null" values and add where clauses to your SQL query based on whether or not a value was selected in the SELECT list.
    For example, I have a report parameter screen that has a state drop down list that returns a value of -1 if no state is selected. I can, therefore, code:
    IF :P6_STATE_CODE != -1 THEN
    query := query + " WHERE state_code = ' ||
    :P6_STATE_CODE ;
    END IF ;
    I have a more complete example if you would like to send me an email ([email protected])
    Jeff

  • Generate  Report based on latest request

    Hi Frds,
    Can we able to generate the Report based on the latest request.
    if so , explain me clearly
    thanks,

    Hi,
    1. Create 3 variables for Request ID, customer exit, single value, uncheck ready for input (e,g. ZEXIT01. ZEXIT02 , ZEXIT03).
    ZEXIT01 represents request of Source1 , File1
    ZEXIT02 represents request of Source1 , File2
    ZEXIT03 represents request Source2, i.e. for source1 the two most recent requests
    and for source2 the most recent request are provided by these variables.
    2. For ZEXIT01add attached code to ZXRSRU01: Just modify bold expression according to your scenario.
    3. For ZEXIT02 change  IF SY-TABIX = 1 to  IF SY-TABIX = 2 , WHEN 'ZEXIT01'.to
    WHEN 'ZEXIT02'. and add code to ZXRSRU01.
    4. For ZEXIT03 change 'YOUR_INDOSOURCE' to IS-name of Source2,WHEN 'ZEXIT01'.to WHEN 'ZEXIT03'. and add code to ZXRSRU01.
    5. At last assign these  variables in Query Designer to characteristic Request ID.
    Sample Code:
    WHEN 'ZEXIT01'.
        TABLES:RSSELDONE,
               RSICCONT.
        DATA: L_T_SELDONE LIKE RSSELDONE OCCURS 0 WITH HEADER LINE.
        DATA: L_T_ICUBE LIKE RSICCONT OCCURS 0 WITH HEADER LINE.
        DATA : REQNO1 TYPE RSSELDONE-RNR.
        SELECT * FROM RSICCONT INTO TABLE L_T_ICUBE WHERE
               ICUBE = <b>'YOUR_CUBE'</b>.
        SORT L_T_ICUBE BY RNSIDLAST DESCENDING.
        SELECT * FROM RSSELDONE INTO TABLE L_T_SELDONE WHERE
               SOURCE  = <b>'YOUR_INDOSOURCE'</b>.
        SORT L_T_SELDONE BY RNR.
        LOOP AT L_T_ICUBE.
          IF SY-TABIX = 1.
            READ TABLE L_T_SELDONE WITH KEY L_T_ICUBE-RNR BINARY SEARCH.
            IF SY-SUBRC = 0.
              REQNO1 = L_T_ICUBE-RNR .
              EXIT.
            ENDIF.
          ENDIF.
        ENDLOOP.
        CLEAR L_S_RANGE.
        L_S_RANGE-OPT = 'EQ'.
        L_S_RANGE-SIGN = 'I'.
        L_S_RANGE-LOW = REQNO1.
        APPEND L_S_RANGE TO E_T_RANGE.
    Best Luck
    Joe

  • Generating report based on dynamically generated sql query

    I have to rewrite asp reports to oracle reports.
    The original application has forms in asp where reports are generated dynamically based on the options selected.
    There are many options to select.
    Some add filter criteria to where clause.
    I have no problem with this. As i can generate report using parameter form.
    whereas i don't know how to generate reports whose columns change based on the user selection.
    The front end screens are going to be in java and jsp pages. The only way i can think of is generating reports on all possible options the user may select. But, as there are more than 15 options, i think this is not the right approach.
    How can i achieve this.
    Thank you very much.
    navya.

    One method that comes to mind would be to use an after parameter form, and use lexical parameters to create dynamic statements.
    For example in your after pform:
    If :P_NAME = 'JOHN' then
    :P_SELECT = 'SELECT COL1, COL2 ';
    :P_FROM = 'FROM JOHN ';
    :P_WHERE = 'WHERE COL3 = 'JOHN';
    END IF;
    Then in your query, you could say:
    &P_SELECT
    &P_FROM
    &P_WHERE
    Something like that - If only parts of you where statement will change, you can just write that one part -
    like
    IF :P_STATE is not null then
    :P_STATE = ' and table.state = :P_STATE_IN ';
    else :P_STATE = ' and 1=1 ';
    end if;
    and in your query...
    where....
    &:P_STATE
    So IF a person enters a state, then limit the search to that state, or else do a 1=1.
    Hope this gives you a start

  • Filter report on multiple select lists dynamically

    Hello
    Can somebody tell me how to filter/refresh a interactive report based on multiple select lists?
    The select lists are created with apex_item.select_list_from_query, because I need to create them dynamically.

    do not post duplicate questions/posts when you already have {message:id=10453848}
    It doesn't make any sense

  • A Date prompt defaulting the data in Report based on selection

    Gurus,
    I have a requirement , where i have a (in between) date prompt set in the dashboard current defulting to Start Month date and End Month date of current month.
    What the user want is based on the selection using a drop down in dashboard which has got values Last Day, Last week, Last Month , the default values in Date filter should change in dashboard.
    For Eg. If the user select Last Week, the in between date filter show the default date value as Last Week Mon and Last Sun, and should filter out the report based on that.
    Any idea's are welcome....
    Thanks & Regards
    -Saurabh

    Try to see if you can get user to agree on something easier.
    Here are the steps to achieve what you want.
    1. Create a prompt for 1 day, 2 week, and 3 month
    2. Create three separate reports based on above selection, which has page prompt for day/week/month respectively.
    3. Create GN based on step in 1 and then let UI change between three reports you created in step 2
    I hope this helps,
    Best luck

  • Based on select list, i need to retrieve values in other select list

    Hi,
    am new to apex using apex3.2, i need to retrieve values in select list based on the other select list vale with out refreshing page.
    ie i have region select list and country select list,in country corresponding region country must be display but with out refreshing page.
    can you please any body guide me.
    Regards
    shashidhar
    Edited by: 871140 on Jul 7, 2011 10:34 PM

    Hi,
    you can use cascading LOV for that, i which the other LOV field will be changing depending upon the selection of other value(which is in LOV).
    http://www.inside-oracle-apex.com/oracle-apex-4-0-cascading-lovsselect-lists/
    Regards,
    Mini
    Mark Answers Promptly

  • Update report based on selected LOV value

    I've searched the forum but could not find the answer how to implement the following:
    I have a form with a popup LOV, element P203_LOCATION_ID, which is populated from a query. When the user picks a value from it, a report in the same page should be refreshed. The report has query "select * from distances where d < 1 AND l = :P203_LOCATION_ID " .
    I created a dynamic action which would refresh the report on change of P203_LOCATION_ID , but the report does not change.
    After looking here, I made a hidden variable P203_SEL_LOCATION which is populated by dynamic action on change, with javascript $v('P203_LOCATION_ID') , and then a second rule in the dynamic action should refresh the report. The query in the report is changed to use :P203_SEL_LOCATION as a parameter.
    Although, when made display-only, P203_SEL_LOCATION does change (and console.log shows the selected ID), the report does not see that change and remains empty. I tried both IR and classic report, same result.
    Any help would be appreciated, how to make change in Items visible to the report?

    Hi Mila,
    I assume that you have checked that the report refresh process is happening and that by "empty" you meant that the report was not fetching any records whereas it should have for the value you see in the page.
    It could be because the changed values is not is not yet set in the session for the report to see(report fetches the bind value of the item P203_SEL_LOCATION from the session).
    You will need to add the item's value to the session before firing the report refresh.
    One way to do that would be to add a PLSQL process as true action with the sequence order lesser than the refresh.
    In the items to submit_ , give P203_SEL_LOCATION
    And the process needn't do anything(what we wanted was the P203_SEL_LOCATION be set, which would be done before executing this PLSQL)
    BEGIN
    NULL;
    END;Hope that solves your problem

  • Conditional Validation on Textfield(s) based on Select/List - help needed.

    Hey Gang,
    I have a simple page where a select/list menu with values "1" through "5" determines how many following textfields require validation. There is an "onchange" event which calls a function to update the validation. Below is my code:
    [ body tag *spry js/css scripts are called in head]
    <form id="form1" name="form1" method="post" action="">
      <p>
          <select name="menu" id="menu" onchange="menuFunction()">
            <option value="0" selected="selected">0</option>
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="5">5</option>
          </select>
      </p>
      <p>
        <span id="sprytextfield1"><input type="text" name="text1" id="text1" /></span><br />
        <span id="sprytextfield2"><input type="text" name="text2" id="text2" /></span><br />
        <span id="sprytextfield3"><input type="text" name="text3" id="text3" /></span><br />
        <span id="sprytextfield4"><input type="text" name="text4" id="text4" /></span><br />
        <span id="sprytextfield5"><input type="text" name="text5" id="text5" /></span>
      </p>
    <p><input type="submit" name="submit" id="submit" value="Submit" /></p>
    </form>
    <script type="text/javascript">
    <!--
    function menuFunction() {
          var menuNum = document.getElementById('menu').value;
         for(i=1; i<=5; i++) {
               if(i<=menuNum) {
                    eval("var sprytextfield" +i+ "= new Spry.Widget.ValidationTextField(\"sprytextfield" +i+ "\")" );
               } else {
                   eval("var sprytextfield" +i+ "= new Spry.Widget.ValidationTextField(\"sprytextfield" +i+ "\", \"none\", {isRequired:false})" );
    //-->
    </script>
    [ / body tag etc... ]
    The function seems to work when it requires the validation for the textfields, but not when removing the validation. I've tried doing  eval("sprytextfield" +i+ ".destroy()"); as well without success.
    I've searched through forums and could not find an answer to this (sorry if I missed it)  ... so hopefully somebody can point me in the right direction. (*I found the post w/ the link http://www.spry-it.com/examples/spry-widget-validation-generation-and-destroy/ -- however that page doesn't seem to work *Chrome)
    Thanks for any help! =)
    ~Mike

    Have a look here http://forums.adobe.com/message/2651124#2651124
    If that doesn't help please come back here.
    Ben

  • How to display chart region based on select list in html region ?

    Hi all,
    i'm using 4.0.1.00.03 apex version,in a page i have 2 regions one is html and another one is Chart region.in html region i have a select list and button.when user sign into my application select list have some values in that page,user select's a value and clicks on the button then chart will be displayed.my query is when user first sign into my application i want to dispaly chart region when only select list is selected and clicks on the button.can any one guide me on this.
    thnx in Adv.

    Hi yann,
    thnx for ur reply,
    i have done what u have written but i didn't meet my requirement..
    let me explain what i need exactly
    as of now my application is like this..
    i have a html region in that i have select list(P6_LIST) and go button
    and chart region.
    chart query is like this..
    SELECT your_value
    FROM your_table
    WHERE your_value = :P6_LIST
    AND ...
    how it is working??
    when user sign into my application, user can see html region with 'select list and go button' and chart region with 'no data '.
    when user select a value in select list and click on go button automatically chart region will be dispalyed with chart.
    what i wanted to change is..
    when user sign into my application, user can see html region with 'select list and go button' and no chart region
    when user select a value in select list and click on go button then only user can see chart region with chart.
    plz help me how to do it.. :)
    thnx in Adv.
    Edited by: moulani on Nov 4, 2011 12:05 PM

Maybe you are looking for

  • Adobe Download Manager Creative Cloud.

    I've been back and fourth with customer service about an issue I've encountered after installing creative cloud, more specifically in the downloading stage. Most of the trouble-shooting steps have failed, and although I have not completed them all, I

  • How to activate group specification window in snro ?

    Hi, all SAP experts, In t-code snro for object AUFTRAG i click on delete group ref. tab in group specification window and saved. Now i want that group specification window , so how can i get that window for particular object in t-code snro? Please gi

  • Using the HTML5 Output in Wordpress

    I am trying to get a Flash CC HTML5 canvas output to run in Wordpress and I am having some problems. The files are all linking properly but the animation is not triggering when the page is loaded. When I test the FLA in a browser straight from Flash

  • WF 14500015 approvers not displayed in preview

    Hi all, SRM 5.0 Sp13,ECS We need to implemengt the Item level appr WF 14500015 for SHC based on the Cost centre in the SHC line items . I am trying to test the WF in DEV system .I copied the std implementationm code in a custom implem,entation "SAP_L

  • Classes in BW

    Dear Friends What are the steps to create classes in SAP-BW Cheers