Report with select list and link to call another report

Hi,
I am trying to do 2 reports (REPORT1 and REPORT2).
The first is a summary report (REPORT1).
This report will display sales figures for the year. Now, I need to have a select list in the result set that will have 2 options, depending on which option is chosen, I want to call REPORT2 with the select list as a parameter. How can I do this ?
Let me try to explain what I did.
I created REPORT1 on Page 100
SELECT YEAR, sum(YTD_SALES), APEX_ITEM.SELECT_LIST(1,'DEPARTMENT','Department;DEPARTMENT,Division;DIVISION') Drilldown FROM SALES_ANALYSIS WHERE YEAR > 2000
GROUP BY YEAR ORDER BY YEAR
I created 2 hidden items namely P100_YEAR and P100_DRILLDOWN
I also made the column YEAR as a link and specified both P100_YEAR and P100_DRILLDOWN as parameters to be passed.
Next, I created REPORT2
SELECT YEAR, DECODE(:P100_DRILLDOWN, 'Department', department, 'Division', Division) dept_div, sum(YTD_SALES) ytd_sales
FROM SALES_ANALYSIS
WHERE YEAR = :P100_YEAR
When I run Report 1, it's fine, when I choose either Department or Division from the Select List and click on the link to call Report 2, report 2 is displayed, but the value being passed for P100_DRILLDOWN is not correct and as a result, I am unable to get correct results for Report 2
Am I missing something ? Are there any alternate ways to do what I'm doing ?
Thanks,
Ashok

Hi Ashok,
The link definition will not know the value selected in the list as it is constructed only when the page is being rendered. You would need to create some javascript to handle this. I've done that here: [http://apex.oracle.com/pls/otn/f?p=267:182]
The link on the EMPNO column has been defined in the HTML Expression setting for the column instead of the Link section. The HTML Expression that I have used is:
<a href="#" onclick="javascript:doDrilldown('#EMPNO#',this);">#EMPNO#</a>And, in the page's HTML Header setting, I have added in:
<script type="text/javascript">
function doDrilldown(empno,group)
var g;
var p = group.parentNode;
while (p.tagName != "TR")
  p = p.parentNode;
var x = p.getElementsByTagName("SELECT");
if (x.length > 0)
  g = x[0].value;
var url = "f?p=&APP_ID.:183:&SESSION.::::P183_EMPNO,P183_GROUP:" + empno + "," + g;
document.location.href = url;
</script>When a link is clicked, the doDrilldown function is called passing in the EMPNO value and the "this" object (which identifies the object triggering the call). The function starts from that object and goes up in the HTML tag tree to the nearest TR tag (the row tag that the link is on) and then finds the first SELECT list item on the row and gets its value. It then constructs a URL using this and the EMPNO value and performs a redirect to the second page (page 183 in this example).
Andy

Similar Messages

  • Problems with customizing select lists and popup LOVs

    Hi
    I have 2 problems about select lists and popup LOVs.
    The first one is about a select list in a tabular form.
    It should be created with APEX_ITEM.SELECT_LIST_FROM_LOV or similar and take its values from a named LOV.
    This worked fine but now it should also have the possibility to enter a free value.
    I tried to accomplish that by creating a APEX_ITEM.POPUP_FROM_LOV, but there is a problem with the function that is called by the arrow icon right to the input field (for eg. genList_f11_5()).
    If the row is added by addRow, then it works fine, but if the row is is not empty
    then the function call is like genList_f11_$_row() and the input field gets no value, when a LOV option is selected.
    The other problem is about a select list which should have the possibility to enter a custom value and
    also there should be the possibility to select several values. I tried to implement this by a text area containing the selected values and a multiple select list, with an event handler in each option. The user could click options and they would be copied to the text area. The problem is that I couldn't make the event handler work in IE.
    I would appreciate any ideas about either of these problems.
    Tiina

    Hi,
    If you download application you can see source.
    I have not write any instructions, sorry.
    If you are on Apex 4 you can just load jQuery UI autocomplete library and take ideas from my app.
    If you download my sample in zip there is uncompressed htmldbQuery library.
    You can see that and take only function htmldbAutocomplete.
    Then check jQuery UI document
    http://jqueryui.com/demos/autocomplete/#method-search
    There is method search that you can use open list just by click of input.
    I hope this helps at start.
    Regards,
    Jari

  • Multiple selection list and passing that value to oracle reports

    Hi
    I need to create a multiple selection list and then based on use selection, I need to pass that value to oracle reports. Can any one help with steps on how I can do this. Thanks

    Hi
    Concatenate the multiple values into a string separated by comma and then pass that string to report as a parameter.
    In report query, you have to use the lexical parameter using ' & '
    regards
    SD

  • Trying to use Spry with Select List

    I have a dataset that is static xml. .In the xml file I have
    a node called categoreis and then repeating node of store name,
    phone and address in that category. There are around 15 categories
    and a total of 100 stores with address and phone. I can create the
    select list and add the onchange event to tell Spry which row of
    data was selected in the drop down. I do not understand how to
    generate the detail region that shows the stores for that
    particular category. Any help would be appreciated.

    Always include the following information when asking a question:
    <ul>
    <li>Full APEX version</li>
    <li>Full DB/version/edition/host OS</li>
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)</li>
    <li>Browser(s) and version(s) used</li>
    <li>Theme</li>
    <li>Template(s)</li>
    <li>Region/item type(s)</li>
    </ul>
    taepodong wrote:
    Hi All,
    Bit at loss what i am doing wrong here. Trying to change a field (previously in textfield) to a drop down select list. All works except one. It looks like Multi-selector even though I set the type as Select List
    http://i.imgur.com/Hz7tP.png
    Got no idea what I have to do to change it to drop down. Many Thanks.If you are on apex 4.x, you might have set the Allow Multiple Selection to Yes
    Edit the select list item > Settings > set Allow Multi Selection to No
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/item_types001.htm#HTMDB28627

  • Select list and date picker on one line  -  is this a bug?

    I'm using: Application Express 3.2.0.00.27
    Is the following a bug? If so, how do I get it reported so it will be fixed in a future release of APEX? If not, how do I do it so it ends up the way I want?
    1. create blank page
    2. create html region
    3. create "select list" item (Begin On New Line - Yes, ...Field - Yes, ColSpan - 1, Row Span - 1)
    4. create date picker item (Begin On New Line - No, ...Field - No, ColSpan - 1, Row Span - 1)
    There will be other items displayed in more columns above what I just had you create above. I want the select list and the date picker to display next to each other on same line, so I placed date picker item on same line in same field as select list item.
    HOWEVER... the date picker ends up displayed under the select list item (kind of), instead of next to it on the same line.
    Here's what I get:
    ...................... [Select List Field] Date Picker Label
    Select List Label
    ...................... [Date Picker Field]
    Here's what I want:
    Select List Label [Select List Field] Date Picker Label [Date Picker Field]
    Thanks,
    Steve
    Edited by: sskelton on Aug 3, 2009 11:01 AM
    Edited by: sskelton on Aug 3, 2009 11:02 AM

    Hi Steve,
    I'm not sure if it's the official way, but you could add a post here: Enhancement Request Thread : Post 3.1 - that's what I've been doing :D
    Andy

  • OnChanger="get_ajax_select_xml(this);" with  select list (query named LOV)

    Hello,
    i used Vikas'example Re: cascading lov for tabular form
    i have a problem with Select list (query based LOV)
    when run tabular form i have the following error:
    report error:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    the number of rows of the Lov are 900
    the display variable is 70 char
    is there any limit?
    Thank in advance
    Costanti

    Leo,
    Thanks for the response, but I don't think you quite understand my problem. If I go to the Column Attributes screen for the group_id field, I have the "Display As" drop down set to "Select List (query based LOV)", not "Select List (named LOV)". This requires that the sql query be written in the "List of values definition" text area below. Within that text area I have the following query:
    SELECT DISPLAY_NAME, GROUP_ID
    FROM APPLICATION_GROUPS
    WHERE APP_ID = ?????
    ORDER BY 1
    The APP_ID that I need to reference is for the current row of data that is being processed. Therefore, I can't use a :PNNN_APP_ID variable, because that field does not exist on the page.
    Hopefully this explains it a little better.
    Thanks,
    Kris

  • Select List and detail region

    db11gxe , apex 4.0 , firefox 24 ,
    hi all ,
    i have a master detail page , with an item "test_id" as a select list ,
    and a detail region has also a column "test_id" ,
    what i want is :
    when i change the value of the master "test_id" , the data is retrieved in the detail region where "test_id" = "master_test_id" ;
    how to do so ?
    thanks

    Newbi_egy
    Do you mean that when you change the test in the master you want to refresh the detail?
    Can you put up an example of your tables and foreign keys etc. on apex.oracle.com.
    To me this sounds a wrong model design.
    The detail should only depend on the primary key of the master. And the primary key shouldn't be updatable.
    Nicolette

  • Question on Dynamic Select Lists and Checkboxes

    Hello,
    I am new to APEX, and this is my first posting, I have a question about how to implement dynamic checkboxes from a select list.
    Basically I would have a select list, and based on what item is selected a set of checkboxes would appear.
    I was originally using the Select and Submit property on the select box, which works fine, all of the checkboxes appear appropriately. But the thing is, APEX refreshes the page each time, and since this select box is lower in the page, the user would have to scroll all the way down to where they were before.
    The main requirement is so that the user won't have to scroll down the that position where the select box is each time they select a new option.
    So a work around attempt is to create a javascript that will automatically scroll down to that position on page load ...
    i.e.
    function pageScroll() {
    window.scrollBy(0,50);
    But that didn't work, because for some reason the javascript wasn't appearing.
    Is there a way to either:
    1. Have a dynamic checkbox appear using ajax? -or-
    2. Have the javascript scrolling effect
    Sorry if this is a confusing question, I was wondering if anyone else came across this issue.
    Thanks in advance!!

    Since this Select List plays such an important role on the page, why not create a side-region and put that select list there so you don't have to overwhelm the user and his 'persistence of vision ' with a page that scrolls all by itself to the 1000th line to, then , change the options ?
    just an idea.

  • Select List and Popup LoV for one column

    Hello,
    is there a built-in functionality to show a select list and a popup lov for one column similar to "Condition Type" in the condition region when editing a page.

    Hello,
    No, you have to code that yourself. For instance by adding HTML in the Post Element Text field (like <IMG src=... />).
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    http://www.bloggingaboutoracle.org/
    http://www.logica.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/

  • Help with Select Lists in Classic Report

    Hello,
    I working with APEX 4.1. Oracle 11.
    I have a simple classic report with 4 columns (Username, Role, Read, Update). The Read and Update columns are Select Lists with values of "Yes", "No".
    Report looks like this:
    Username Role Read Update
    JSmith Admin Yes Yes
    LJones Dev Yes No
    My requirement, is that when a user selects Yes from the Update select list, the value of the associated Read column needs to change to Yes as well for that particular Username. The change has to occur upon selection of Yes from the Update select list.
    Im not very strong with javascript, but for testing purposes I applied: onchange="alert('hi');" on the Update column. When I make a change to the Update select list, the alert does pop up.
    Can anyone suggest how I can implement the change to the associated Read value of Yes if the Update value chosen is Yes, for that particular row.
    Thank you,
    Laura

    LauraK wrote:
    I working with APEX 4.1. Oracle 11.
    I have a simple classic report with 4 columns (Username, Role, Read, Update). The Read and Update columns are Select Lists with values of "Yes", "No".
    Report looks like this:
    Username Role Read Update
    JSmith Admin Yes Yes
    LJones Dev Yes No
    My requirement, is that when a user selects Yes from the Update select list, the value of the associated Read column needs to change to Yes as well for that particular Username. The change has to occur upon selection of Yes from the Update select list.
    Im not very strong with javascript, but for testing purposes I applied: onchange="alert('hi');" on the Update column. When I make a change to the Update select list, the alert does pop up.
    Can anyone suggest how I can implement the change to the associated Read value of Yes if the Update value chosen is Yes, for that particular row.Should be possible to do this using a Dynamic Action without writing any (or much) JavaScript. The complexity in this case is that you're using items in a report rather than standard page items.

  • Interactive Report with Select List LOV's

    Hi All -
    I need to develop an Interactive Report which displays reports based on values selected from a select list (LOV's) on this IR report.
    Following is what I am working on.
    This page has 2 select lists with the corresponding LOV values:
    Date From ==> Q1, 2010
    Q2, 2010
    Q3, 2010
    Q4, 2010               
    Date To ==> Q1, 2010
    Q2, 2010
    Q3, 2010
    Q4, 2010     
    When the user visits this report page first time, "Date From" and "Date To" select lists have null values and the report should display all the records.
    Once the user selects values from "Date From" and "Date To" select lists then the report should be filtered based on the values selected i.e.
    If the user selects *"Date From"* ==> Q1, 2010 and *"Date To"* ==> Q3, 2010, then the report should show all the records whose reporting period falls between "Jan 1, 2010" to "Sept 30, 2010" i.e Q1-Q3 2010 only.
    And the Reporting date format stored in the table is "18-OCT-2010", "12-APR-2010" etc ....
    How can this be achieved. Please share your expertise.
    Thanks,
    -Seenu

    Hi,
    First Create 2 Select List with List Of Queries in LOV Region like
    +'STATIC2:Q1-2010;01-Jan-2010,Q2-2010;01-Apr-2010,Q3-2010;01-Jun-2010,Q4-2010;01-Oct-2010'+ in Date From List lets name it P10_DF and
    +'STATIC2:Q1-2010;31-Mar-2010,Q2-2010;30-Jun-2010,Q3-2010;30-Jun-2010,Q4-2010;31-Dec-2010'+ in Date To List P10_DT.
    (Enable Display Null Value on both the select list)
    Then Now in the Report Source add Where Query some thing like
    select FIELD1,FIELD2 from TBL_REPORTS where Report_Date>=NVL( *:P10_DF* ,'01-Jan-2010') and Report_Date<=NVL( *:P10_DT* ,'31-Dec-2010')
    And also create a button to submit the values
    NOTE: This is not tested but this is how i will come about it in the specified scenario. You can try this and post the results...
    Good Luck.
    Regards,
    Afsar

  • Help with select list item and dynamics action

    G'Day Apex Gurus,
    I having problems trying to achieve to trigger the help window of a select item automatically. A help window is triggered when the select item label is clicked but my client would like to be triguered automatically as soon as the user click to see the options in the select list.
    I think that I should be able to do it with dynamic actions but I can not get it to work.
    I know when someone click on the label of the select list item trigger this JavaScript
    javascript:popupFieldHelp('277938589795252851','1545903379570909')
    So I want to trigger the javascript also when the user click of the select list item and pull down the options and for that I think that Dynamic actions is the way to go but I can't get it right.
    This is what I a doing:
    I created a Dynamic option as follow:
    Name : test
    Sequence: 30
    Even: Click
    Selection type: Item(s)
    Item(s): P1_RATING <- a selection list item
    Condtion: - No Condition -
    True Actions
    Sequence: 10
    Action : Execute JavaScript Code
    Fire when event result is :True
    Fire on page load: ticked
    Code: javascript:popupFieldHelp('277938589795252851','1545903379570909')
    I appreciate any one who can tell me what i am doing wrong here or provide a solution to my problem of achieving to trigger the help window of a select item automatically.
    Kind regards
    Carlos

    Hi Carlos,
    I set up a test case in exactly the same way and it worked fine for me. I created a page item called P1_DA_DEMO and added some static select list values then added some help text. The settings I used are below, I suggest you try again but also make sure you have no other Javascript errors on the page. Use a tool like firebug to check.
    Name : Dynamic Action Demo
    Sequence: 10
    Even: Click
    Selection type: Item(s)
    Item(s): P1_DA_DEMO <- a selection list item
    Condtion: - No Condition -
    True Actions
    Sequence: 10
    Action : Execute JavaScript Code
    Fire when event result is :True
    Fire on page load: Not Ticked
    Code: javascript:popupFieldHelp('277938589795252851','1545903379570909')
    Event Scope set a s Bind.
    Thanks
    Paul

  • Report with Select Lists problem

    Hi all,
    I have a sql report with this query:
    select
    'Hello World' Col1,
    apex_item.select_list_from_lov_xl(1,'Data 1','TEST_LOV') lov1,
    apex_item.select_list_from_lov_xl(1,'Data 2','TEST_LOV') lov2,
    apex_item.select_list_from_lov_xl(1,'Data 3','TEST_LOV') lov3,
    apex_item.select_list_from_lov_xl(1,'Data 4','TEST_LOV') lov4
    from dual
    Where TEST_LOV is a LOV that return 400 rows. The problem is that this report gives me an error:
    report error:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    I am able to create a workarround using ajax, but I don't think this is the best way.
    Does anyone knows why this happens or any solution??
    Thanks,
    Alejandro.

    Hi,
    OK - My page is defined as:
    The report is based on the following SQL:
    select
    "EMPNO",
    "EMPNO" EMPNO_DISPLAY,
    "ENAME",
    "DEPTNO"
    from "#OWNER#"."EMP"The DEPTNO column is the one that I need a select list for. I have not used the APEX_ITEM package to handle this, but I expect it could be done that way as well.
    On the DEPTNO column, I have the following settings:
    Display As: Select List (query based LOV)
    Named LOV: -Select Named LOV-
    Display Extra Values: Yes
    Display Null: Yes
    List of values definition: SELECT NULL d, NULL r FROM DUAL
    Note that it is important that you use these exact settings.
    I have then created a new PL/SQL region on the page below the tabular form. The region should use the "No Template" template to keep it hidden from view. The Region Source is:
    DECLARE
    vSEP VARCHAR2(1);
    BEGIN
    vSEP := '';
    htp.p('&lt;script type="text/javascript"&gt;');
    htp.p('var sMaster = new Array(');
    FOR c IN (SELECT DNAME d, DEPTNO r FROM DEPT ORDER BY UPPER(DNAME))
    LOOP
      htp.p(vSEP || 'new Array (' || c.r|| ',"' || c.d|| '")');
      vSEP := ',';
    END LOOP;
    htp.p(')');
    htp.p('&lt;/script&gt;');
    END;This defines a hidden select list as a javascript array using the actual values from the DEPT table.
    I then have an HTML region underneath that, again using "No Template", that has the following as the Region Source:
    &lt;script type="text/javascript"&gt;
    function updateList(sChild)
    var o;
    var sChildValue = sChild.value;
    sChild.options.length = 0;
    o = new Option('-Select-', '');
    sChild.options.add(o);
    var k;
    for (k = 0; k &lt; sMaster.length; k++)
      o = new Option(sMaster[k][1], sMaster[k][0]);
      sChild.options.add(o);
    sChild.value = sChildValue;
    if (sChild.selectedIndex == -1)
      sChild.selectedIndex = 0;
    function updateLists()
    var lists = document.getElementsByName("f03");
    var k;
    var x;
    if (lists)
      for (k = 0; k &lt; lists.length; k++)
       updateList(lists[k]);
    updateLists();
    &lt;/script&gt;For this example, you will note that I am refering to "f03" (in the updateLists() function) - my DEPTNO column's SELECT tags have "f03" as their NAME attributes. This may need to be changed for your page.
    And that's it!
    When the page is loaded, the tabular form is constructed. Due to the settings I've applied to the DEPTNO column, each list will actually consist of a NULL entry and the value on the record (that's due to setting Null/Extra Values to Yes).
    Then, a hidden select list is constructed as a javascript array. And, finally, we loop through each of the "f03" items on the page, take a note of the value already there, replace the contents of the dummy select list with the contents of the array and then select the original value again.
    Andy

  • How do I create an unordered list with three items and link to id's

    How do I create an ordered list with three items and linl to id's on my page

    Thanks, I guess what I was really asking, Is there a n option in the insert menu or somewhere where Dreamweaver does it for you.
    I am not clear on what you are wanting DW to do for you?  Is it that you want it to insert a three item unordered list?  No - there's no such function.  You would need to click in Design view where you want the list to go, click on the bulleted list icon on the Property inspector, and then enter the three items separated by carriage returns.  Then you'd have to link each item specifically.
    To enter the named anchors to element ID values, CS5 has no way to do this.  You'd have to enter those links manually.

Maybe you are looking for

  • Text wrap issue:ShowDetaillItem chop-off in the PanelAccordion.

    Issue: Text wrap issue in ShowDetailItem header. Tittle of the S+howDetaillItem+ chop-off does not display completely in the PanelAccordion. I have a few texts that does not wrap in ShowDetailItem Header used for the panel accordion. I could not fix

  • How do I allow a user to enter multiple lines of text within a Text Entry Box?

    I need a text entry box that allows for multiple lines to be inputted with in a Text Entry Box.  How can I make this possible?

  • Error when setting up connection from Universe Designer to Oracle database

    Hello, I am attempting to create a connection to an Oracle 10 database in Universe Designer.  I am currently running Business Objects XI 3.1 SP3 on a 32 bit machine.  I have the Oracle client installed.  In Universe Designer when I attempt to create

  • Customization of BC4J

    Hi, I need to extend a SupplierSitesVO. I downloaded the VO from the server to my local machine and opened the VO in Tutorial.jpr I also brought all the dependent objects by referring to server.xml to the respective folder, but when I am trying to re

  • WAD / Multiple Queries / Performance

    Hi Experts I have a WAD Application, with several (actually, 71) queries. The startup performance is horrible. In note 1056259, paragraph 3.4.2, SAP indicates that we should not start all the queries automatically when the WAD is launched, but only w