4 Replies Latest reply: Jan 16, 2013 9:44 PM by Roadling RSS

    Report Select List

    NewApexCoder
      I have a problem with my select List.

      I have created a report. I wrote a query to retrieve the desired results. Inside of this reprot, there is a column named category that has about 6 different categories (a-f). I want to place a select list on the report that will choose a category. Once a category is chosen, it will select those results with that particular category that was selected.

      I have my select list above the report, but am not sure what/where to put the code to produce the results based on which category is chosen. Can anyone help with this??

      Thanks in advance.
        • 1. Re: Report Select List
          Howard (... in Training)
          Hi,

          Here's an example: http://apex.oracle.com/pls/apex/f?p=41871:3 Dever Ima9Dever

          It uses the selection List variable (:P3_SL_SYS_NIC_NM) in a chart series label (EMPNO || '-' || :P3_SL_SYS_NIC_NM) -
          SELECT NULL LINK, EMPNO || '-' || :P3_SL_SYS_NIC_NM LABEL, SAL "Employee Salary" 
            FROM EMP
          So you can see the A, B, C or D in the label on the "X" axis toward the bottom of the chart.

          But there is a "wrinkle" you may not want. There is a Dynamic Action, so when the Select List changes, the page is submitted and the chart updates with the new label values. There's no usefulness here, I was just trying to show what could be done.

          Best wishes,
          Howard
          • 2. Re: Report Select List
            NewApexCoder
            whats the username and password to look at the example

            Also, but what about my query that generates the already made report? Won't I have to make changes to that query?

            And I'm not familiar with the syntax --> ||'-'||. Isn't that used to concatenate two items/columns?
            • 3. Re: Report Select List
              Howard (... in Training)
              Please look again. The username and password are there.
              Also, but what about my query that generates the already made report? Won't I have to make changes to that query?
              If your report already references the Select List variable, I'd think it ought to be working. But I have seen -- in my own code -- where the Select List variable was there on the screen staring me in the face but it was "NULL" to the session and to my code that was checking for it. Or it was the value from last time around. Make sure that your "Source" definition for the Select List variable has Source Used:"Always, replacing any existing value in session state," and Source Type: "Static assignment" and make the "Source value expression" is "&<select-list-variable-name>." (period!) This worked for me.
              And I'm not familiar with the syntax --> ||'-'||. Isn't that used to concatenate two items/columns?
              That's just PL/SQL string concatentation. I'm putting a dash between the employee number and the letter selected.

              Howard
              • 4. Re: Report Select List
                Roadling
                Hi,

                It seems to me that you are almost there if you have a select list in your region already then you would just need to update the where clause of your report query.

                lets assume that your select list has the item name :P3_CAT

                you would just change your query to something like
                select col1, col2, col3 from sometable where col3 = :P3_CAT
                when you submit the change to the select list the page will update with the new where clause.

                - Brad

                Edited by: Roadling on Jan 16, 2013 9:44 PM