Column based on LOV in a classic report

In a classic report i want to display a value coming from an lov, based on the value of a column. I can't seem to make this work however, not even on apex.oracle.com. I too am on apex 4.1.
What i've tried is to set the column to display as text, based on lov. I've tried named static and dynamic lovs, and tried to supply an own lov definition, both static and dynamic. Even apex_item doesn't seem to work.
As a test, i has set this up on apex.oracle.com:
Classic report:
Region source:
select status, descr, apex_item.text_from_lov(status, 'lov_status') status2
from
select 15 status, 'test for status 1' descr from dual
union all
select 30 status, 'test for status 2' descr from dual
union all
select 45 status, 'test for status 3' descr from dual
Column attributes for column status:
Display As: Display as Text (based on LOV, does not save state)
List of Values -> Named LOV: LOV_STATUS
LOV_STATUS (shared components -> lists of values):
this is a static lov, with these values:
15;'Status One'
30;'Status Two'
45;'Status Three'
60;'Status Four'
(which could also be used as a non-named lov like: STATIC2:15;'Status One',30;'Status Two',45;'Status Three',60;'Status Four')
Both column status as status2 simply keep displaying their value, and not the 'display value' i'd expect coming from the lov.
I could use decode or case, yes. But using an lov keeps it cleaner, especially when there are more than 3 or 4 values, and could be reused in more reports.
Am i using or doing this wrong?

Hi Tom,
revert the order of your LOV items ( so first description and then ID ),
like for example :
STATIC2:'Status One';15,'Status Two';30,'Status Three';45,'Status Four';60
That does the trick ( tried it ).
If you want to see an example check page 2 of the only app on apex.oracle.com
WS : bklerk
User : demo
PWD : demo123
Regards
Bas

Similar Messages

  • Bug: Report Column based on LOV character string buffer too small error

    When using a column type of "Display as Text (based on LOV, does not save state)" with a result set that is rather large causes a character or string buffer too small oracle error.
    See the below page for an example.
    The example page below has a single report off a table called "HUGE_TABLE" which has two columns: display and code
    Code contains a number between 0 and 100000.
    Display contains the number in code appended to a block of text.
    When I display the report with no Display As Text (based on LOV does not save state) it displays fine.
    If I make the "Code" column display as text based on LOV and make the LOV
    "SELECT display, code FROM huge_table"
    I get the error you see on the page.
    http://apex.oracle.com/pls/otn/f?p=32149:1
    Thanks.

    Thanks for your help Scott.
    So from what I've gathered from my own tests and the discussions you linked me to the LOVs based on SQL queries are being converted into "static LOV" strings before being used.
    As such they are limited to the PL/SQL VARCHAR2 max size of 32767
    Which means given the static reduction of the string 'STATIC:' that we have 32760 characters left.
    Which is where your SUM( LENGTH( display ) + LENGTH( return ) + 2 ) comes in.
    In short, if:
    sum( length( display ) + length( return ) + 2 ) + 7 > 32767
    would evaluate to true then you have a problem. :)
    I'll use this to track down my problems and switch them over to inline queries.
    Thanks.
    Cheers,
    Joe

  • Urgent - Report Column based on LOV - Value not found in LOV

    Hi All,
    Recently, we have upgraded to HTMLDB 2.0 from HTMLDB 1.5.
    I have a SQL report. One of the columns is based upon LOV - Display as Text (Based on LOV, does not save state).
    For the "Ids" of the report, it should display the corresponding "Names" from the LOV.
    But, for the cases, where no record exist in LOV for some Id, then it is directly showing the Id instead of "-" (which i have specified in Display Null Text) in the report column attributes.
    Before upgrade, it was working fine.
    Any idea where is the issue.
    Please help.
    Thanks in advance,
    Monika

    Hi,
    Can anybody help me in sorting out this issue please.
    For your reference, i have made a test case on
    http://apex.oracle.com/pls/otn/f?p=20451:4:3519837362944582:::::
    Here, there are 2 tables
    1. MY_EMP_COUNTRY(emoid, empname, cntry_id)
    2. MY_COUNTRY_LOOKUP(id, name,active)
    LOV is created on table 2
    select name d, id r
    from my_country_lookup
    where active = 'Y'
    And, on the page a SQL report is created
    select empname, cntry_id
    from my_emp_country
    where, cntry_id is based upon the LOV.
    Since, in lookup table, cntry_id = 4 is set inactive, it is not picked up by the LOV and hence on the report instead of showing the NULL text it is showing the cntry_id (4).
    The attributes of report column cntry id -
    Named LOV = CNTRY_LOV
    Display Null = YES
    NULL text = -
    Display Extra Value = YES
    Am I missing anything.
    thanks,
    Monika

  • Sorting report by column based on LOV problem...

    All,
    I have an issue with a report I have written.
    I have an LOV based on a sql where which returns an ID as a return value and a CODE as a display value.
    Lets say the LOV returns the following results:
    Return, Display
    1, V
    2, A
    3, T
    When I click on the item column heading to sort the report based on that column the records are in the order 1, 2, 3 and not A, T, V.
    So it looks like it is sorting the results based on the return value and not the display value.
    Is this a feature of displaying items based on LOVs in reports and then sorting on them or am I missing something.
    Hopefully, someone can help me out here as it is driving me mad.
    Regards
    ChrisR

    Chris,
    This didn't change in 3.1 and that is definitely not a bug but a feature. The solution I
    propose is a simple workaround for the special cases of LOV display columns or columns
    where you have an image but still want to do sorting.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/apex/f?p=107:7
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How to color single column cells with different colors in classic report based different conditions

    Hi ,
      Am working on Oracle Apex 4.2 version. Am trying to generate a  classic report with different cell colors based on the conditions.
      I tried the solution provided in the below link.
      https://forums.oracle.com/message/9518723#9518723.
      I tried the same query given in that link.
       SELECT e.*,
      CASE
        WHEN sal < 1000
        THEN 'red'
        WHEN sal BETWEEN 1000 AND 2000
        THEN 'yellow'
        WHEN sal > 2000
        THEN 'green'
      END the_color
    FROM emp e
      And, I hidded the column 'the_color' in Report Attributes,
              the Column Template1 has the code , <td #ALIGNMENT# headers="#COLUMN_HEADER_NAME#">#COLUMN_VALUE#</td>.
    After this, what are the steps did I miss here. Because am not getting the report which I need.
    Kindly do provide solution.
    Thanks,
    yashu.

    SAL column values should visible with different color based on the conditions. Same way i did in my report it was working for me. Please refer the below links for more information,
    https://forums.oracle.com/thread/1047891
    http://dbswh.webhop.net/htmldb/f?p=BLOG:READ:0::::ARTICLE:351800346145832
    Thanks
    Lakshmi

  • Form pagination based on search results. Classic report

    hei folks,
    can anyone give me idea how to implement form pagination based on report search results on other page?
    and im using Classic Report.
    pagination by default gives me 1...count(rowid) number of pages
    best regards,
    Simon

    Done.
    Process Get Next or Previous Primary Key Value has a field Optional WHERE clause, you can repeat the 10 store high Where clause from your original report (on page 1). If report includes more then one table - use a view, because inside Optional WHERE clause you can only use one table/view.
    nJoy,
    Simon

  • Determine the Struture columns Based on User Entry in Bex Report

    Hello Experts,
    I have requirement as below.
    Requirement: Create a Bex report to Display Credits and Sales based on Fiscal Period in Rows and Profit centers in Columns ( PC1, PC2, PC3....PCN where N is Number of Profit centers a user entered in Selection screen).
    I want to take Fiscal Period, Sales and Credits in Rows and Each profit center in Seperate Columns. The Tricky part is, I cannot define a structure with fixed number of Columns since User can Enter any number of Profit Centers in the selection Screen.
    To put it simple terms, I have to Pass the Profit Center Variable Values to the Structure and Determine the Number of Columns in the Structure Dymanically at runtime..
    Can this be done. If so Please let me know the Solution.
    Thank and Regards,
    Prashanth

    Hi Pasha,
    Thanks for responding back.
    Actually there are 2 other Columns that I did not mention above. First Column is to Display values for all Profit Centers and the other Column is to Display the difference of Total - 'Values of all the Profit Centers that the user has selected'. Im not sure how it will work if I put the PC Char outside the Structure.
    Please let me know If you have some more thought.
    Thanks,
    Prashanth

  • Bug report? WITH statement in classic report LOV

    I've defined a "select list with query based lov" in a classic report column, and if I attempt a with clause
    with data as (Select 4 qty from dual)
    select round(100/qty*(level-1)) perc, round(100/qty*(level-1)) c
    from data
    connect by level <= qty +1I receive this error
    WWV_FLOW_UTILITIES.ERR_LOVORA-06550: line 1, column 45: PLS-00428: an INTO clause is expected in this SELECT statement
    ORA-06512: at "SYS.DBMS_SYS_SQL", line 1249
    ORA-06512: at "SYS.WWV_DBMS_SQL", line 930
    ORA-06512: at "SYS.WWV_DBMS_SQL", line 999
    ORA-06512: at "APEX_040200.WWV_FLOW_DYNAMIC_EXEC", line 695
    ORA-06512: at "APEX_040200.WWV_FLOW_UTILITIES", line 927>
    It's fine when I remove the WITH and place my value inside the rest of the query.
    Expected?
    Application Express 4.2.1.00.08

    Query is fine... worked on it [url https://forums.oracle.com/forums/message.jspa?messageID=10902901#10902901]elsewhere first ;-)
    with data as (Select 4 qty from dual)
    select round(100/qty*(level-1)) perc, round(100/qty*(level-1)) c
    from data
    connect by level <= qty +1
    PERC                   C                     
    0                      0                     
    25                     25                    
    50                     50                    
    75                     75                    
    100                    100

  • Radio group in classic report based on another column on the same row.

    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    Application Express 4.1.0.00.32
    How can I have a radio group column based on an LOV utilizing another column on the same row of the report?
    For example: what if I had a survey application and depending on the likert scale that was assigned to the question there would be different possible answer choices:
    Question 1 on row 1 of the report: The class instructor was friendly?
    Likert scale choice is Agreement.
    Choices on Radio Group: Strongly Agree, Agree, Undecided, Strongly Disagree
    Question 2 on row 2 of the report: The class offered good materials?
    Likert scale choice is Quality.
    Choices on Radio Group: Excellent, Below Average, Average, Above Average, Excellent
    The radio group can change per row depending on the Likert scale assigned to the question which is assigned to a different column on the row.
    Can LOV utilize the column? :
    SELECT scale_text
    FROM scale_choices
    WHERE scale_category_choice_id = 2 <<= this would be the Likert scale identifier
    ORDER
    BY display_order

    Here is the answer:
    APEX_ITEM.SELECT_LIST_FROM_QUERY(
    p_idx IN NUMBER,
    p_value IN VARCHAR2 DEFAULT NULL,
    p_query IN VARCHAR2,
    p_attributes IN VARCHAR2 DEFAULT NULL,
    p_show_null IN VARCHAR2 DEFAULT 'YES',
    p_null_value IN VARCHAR2 DEFAULT '%NULL%',
    p_null_text IN VARCHAR2 DEFAULT '%',
    p_item_id IN VARCHAR2 DEFAULT NULL,
    p_item_label IN VARCHAR2 DEFAULT NULL,
    p_show_extra IN VARCHAR2 DEFAULT 'YES')
    RETURN VARCHAR2;

  • Report "Display Text (Based on LOV)" columns don't like colons - Bug?

    This is a bit hard to explain in text, so I've built a sample app: http://apex.oracle.com/pls/otn/f?p=9608:1
    The app has two pages, which demonstrate two related bugs in the handling of Report "Display as Text (based on LOV)" columns.
    Basically, if the LOV query returns a string that contains colon characters (":") in the display column, the values are matched up correctly, but the colons are stripped from the display.
    If the LOV query returns a string that contains colon characters in the return value column, then the matching fails entirely.
    Removing the colon characters eliminates the problem.
    We actually ran into this in a production environment, after an upgrade from Apex 3.0.0 to 3.2.1. The behavior definitely did not occur in Apex 3.0, but was added at some point between the two versions.

    The colon is actually part of our data (the field in question is a URN namespace).
    And yes, I understand the function of the colon in Apex URL parameter passing. However, I wouldn't expect that sort of parsing to be used against the results returned from an LOV query.
    Also, the LOV is fine in of itself -- a select list based on the LOV displays & returns the expected values. It's only when I use a report column based on an LOV that this behavior creeps in.
    We've found a (fairly painful) workaround -- altering both the report query and the LOV query to to do something like replace(column, ':', '_') -- but that's a manual change to a large number of pages for us.
    This behavior is new to version 3.2.1. It didn't happen in version 3.0.

  • Bug report - classic report lov defn retained when no longer relevant

    Hi,
    In January I spotted a case where, attributes were retained after a selection was changed, and related fields are hidden in the dev environment.
    http://www.grassroots-oracle.com/2013/01/dynamic-action-hidden-false-actions.html
    Anthony Rayner asked me on twitter for other examples and I just found one.
    Classic report - column display as "Select list (query based lov)"
    Add LOV sql.
    Change back to "Standard report column" or "display as text...", save.
    Change to "select list..." -> lov definition re-appears.
    I actually founds this after setting the column to standard report column, then copying the page - the LOV was present in the new page!
    Scott

    Scott,
    Thanks for following up on this. I have filed bug #16482841 for this, which will be looked in the next major release.
    Thanks again.
    Regards,
    Anthony.

  • How to Link column header only in classic Report in APEX 4.1

    Hello Everybody,
    Probably there is a simpler way to do this, but I am not sure. I want a link on column header in Report on a specific column. The link will take me to new region or a page.
    How to achieve this in APEX 4.1
    Theme : Blue 2
    Database 11g
    I see there is a column link opiton, but that creates link for every row in that column on a specific icon, I just want link on a title of the column in Classic Report.
    For Example,
    if there are two columns Name and Client ID, which has 10 records to display on a classic report. I wan the link on Client ID on header only not on the records.
    Can anybody provide some simple solution for this.
    Thanks,
    --CP
    Edited by: cpora007 on Jun 22, 2012 10:38 AM

    Hello,
    I didn't understand, what do you mean by default it is going to sort popup. I have a classic report based on SQL, which generates a report with static header, there is no sort or any other link on that.
    I added a link in column header name with an anchor. It works and takes to the new page.
    But it is not a proper solution. A solution based on Jquery dynamic action is preferable. Also the preferred option is that the link opens a hidden region of the same page at the same location of the report and the report gets hidden. after the procession on the form region and submitting the update/ insert process. the report region shows up with the change data.
    Moving on to new page is 2nd option, if the first do not work.
    In the JavaScript, put: apex.submit("GO_TO_MY_OTHER_PAGE");
    On the page, create a Branch to the Second page. Set the condition to Request=Expression 1. Set the request to "GO_TO_MY_OTHER_PAGE"
    On which page I need to create a branch?, Is it on the report page or the form page.
    Thanks a lot for the response. I appreciate your kind efforts in this regard.
    --CP                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Classic Report - Column Conditions Not taking Effect when Changing Pagination

    Apex Version:  4.2.1.00.08
    DB Version: 11g Release 11.2.0.3.0
    Hi,
    I have a classic report that has some columns that conditional hide/show depending upon the value of a page item.  When the report is first displayed with the first pagination set(Rows 1-100), the columns display as they should.
    When moving to the next pagination set(Rows 101-200), the columns no longer display as they should and it seems that the condition is not taking effect.  Partial Page Refresh is set to 'Yes' for the report.
    Any ideas on why this might be occurring?

    tvanderl
    Assuming you mean that columns are rendered while you expect them not to.
    Are the conditions based on page items.
    It could be that the session state of those items is different between when the page is first rendered and when de refresh due to the pagination is done.
    See if adding the in the condition used page items to the page items to be submitted for the region helps.
    Others wise see if you can replicate the issue on apex.oracle.com so we can see what you mean.
    Nicolette

  • How to display special characters in APEX Classic Report column

    Ref: Thread: How to display newline characters as new lines
    Version: APEX 3.2
    Hi,
    I have created an classic SQL Report with one of the columns being a decode that gives a value 'Post'(the value should be highlighted in Red) on one condition and 'Pre' on another. I have followed the advice given in the page (URL provided above) , i.e. I have changed Strip HTML to 'No', changed Display as to 'Display as text (escape special characters, does not save state)'. I have also passed this value back to the same page to be stored in a page item each time a link (another column in report) in report is clicked. I have tried passing it as #DEADLINE# and \#DEADLINE#\. The issue I face is, instead of the value being highlighted in Red, it gets passed back as a string holding the value 'Post'. Is there any way I can get this to display as it should without the Strip HTML being changed to 'Yes'.
    Thanks very much.
    Rohi
    Edited by: Rohi on 18-Jul-2012 04:21

    876651 wrote:
    Hi,
    Thanks for your response.
    I am trying to display a page item that is derived from a report column based on a click on the URL link (*view >*>)
    This page item (here, it is Manager_ID) should ideally be highlighted when a particular condition is satisfied (achieved using a DECODE in the report).
    But it is not displayed like it should be.
    I do not want the value to be displayed along with the html tags as a string.
    I want the html tags to take effect and highlight the value within it.
    Initially, I had set Strip HTML to Yes and the value was returned without any highlighting .
    So I changed it to 'No' and and it contained the html tags.
    I am not sure what setting in APEX Report Attributes can help me achieve that effect I want.None of the report settings are relevant. They affect the rendering of the report and none of the columns you were changing the properties of were actually rendered.
    You can't pass HTML and CSS around in URL parameters.
    I suggest you pass *2* values in the column link: the MGR ID and a simple class or colour value computed by the DECODE in the report. I've suppressed the first version of the report and created a new one that does this:
    decode(dept.deptno, '30', 'c00', '000') highlight The link column now passes the MGR ID and the HIGHLIGHT colour (red when the condition is satisfied and black when it is not).
    I created another hidden and protected page item <tt>P0_HIGHLIGHT</tt> as the target for the highlight value, and used the Pre/Post Element Text properties of the <tt>P0_G_MGR</tt> to wrap it in a <tt>span</tt> whose colour is changed using the <tt>P0_HIGHLIGHT</tt> value as a subtitution string:
    <span style="color: #&P0_HIGHLIGHT.;">Having done that, I still don't really get the requirement here. I'm sure that given the full picture I'd be using a completely different approach...

  • Dynamic action in column of classic report

    Good day master!
    Hi im new in apex,, so im dynamic ondering if its posible to create a dynamic action in the column of classic report in apex?
    i'm trying but its not working my problem goes like this..
    i have a classic report stock_replenish
    columns
    item_code
    price
    supplier_name
    item_code is a pop-up loved by sql
    what i want to do is when the user choose a item_code it will also return the price and supplier_name
    i can do that in apex form but i dont know if iits posible to clasic report?
    please help!
    ty
    Myke;l

    Dynamic action on report columns is possible but not as straigth forward as on items.
    First you can't select "report colum" as selection type for the dynamic action. Use jQuery Selector instead.
    See the [url http://api.jquery.com/category/selectors/]jquery documentation  on possible selectors.
    I prefer to use something like[name='f01'].
    Use the developer tools of your browser to see the name of your report column.
    Because you can't submit a single report cell value with the action "Set value".
    You have to use a combination of a action "Execute javascript" and a ondemand process.
    The javascript code is something like
      var elementId,idParts,row;
      /*Determine the id of the element that has triggered the dynamic action*/
      elementId = String(this.triggeringElement.id);
      /*The id of a item in a report column consists of to parts the name and the rownumber*/
      idParts = elementId.split('_');
      /*The second part is the rownumber we need that to set the value in the right row later on*/
      row = idParts[idParts.length-1];
      /*This calls the ondemand process*/
      apex.server.process ( "MANAGER_EMAIL", {x01:$v(this.triggeringElement),x02:row}, {success: function( pData ) { $s(pData.r,pData.d) }} );apex.server.process(name ondemand process,values to be submitted,options)
    {x01:$v(this.triggeringElement),x02:row}
    This submits the values of the triggering element and the row on which all the action is happening.
    x01 refers to apex_application.g_x01
    {success: function( pData ) { $s(pData.r,pData.d) }}
    The succes option defines a function that is executed upon succefull completion of the ondemand process.
    The ondemand process returns a json object. Which we can refer to in the javascript function with pData.
    In our ondemand process we are defining the json object as having to properties.
    d and r . d is the display value and r is the id of the element to be set.
    $s(r,d) is a [url http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/javascript_api.htm#CDEEIGFH]apex javascript function that sets the value d to item with id r.
    Now the server side code. This is an application process with process point Ondemand.
    Which is something like this.
    declare
      cursor c_emp(b_employee_id in number)
      is
        select emp.email
        from   oehr_employees emp
        where  emp.employee_id = b_employee_id
      col_emp_email oehr_employees.email%type;
      v_regel       number;
    begin
      /*Get the employee email*/
      open  c_emp(apex_application.g_x01);
      fetch c_emp
      into  col_emp_email;
      close c_emp;
      /*Calculate the rownumber do this only if the triggering element is a popup lov*/
      v_regel := to_number(apex_application.g_x02) + 1;
      /*Create the json header*/
      APEX_PLUGIN_UTIL.PRINT_JSON_HTTP_HEADER;
      /*Print out the json object*/
      sys.htp.p('{"d":"'||col_emp_email||'","r":"f03_'||lpad(to_char(v_regel),4,'0')||'"}');
    end; For specification of the JSON notation see [url http://www.json.org/]http://www.json.org/
    To see this in action I have set up a [url http://apex.oracle.com/pls/apex/f?p=VANBAREN_FORUM_TRY_OUT:TBDA:0&c=VANBAREN]demo.
    Change the manager and the manager email will change.
    I hope this is enough to get you started.
    If you have a problem in translating the above code to your specific situation set something up on apex.oracle.com. Then the help can be more specific to.
    Nicolette

Maybe you are looking for

  • Help with a binary tree

    I'm writing a binary tree class and am having some trouble with the Insert function. Here is the code for the TreeNode class... public class TreeNode      TreeNode Left;      TreeNode Right;      String Name;      public TreeNode(String NodeName)    

  • SharePoint Hosted App - Creating cascaded drop down on hosted web lists

    Hi, I have created an SharePoint Hosted App(Javascript Object Model) that creates lists on the host web. I need to put some javascript into new and edit forms in order to create the cascaded drop down effect on 2 lookup fields. Can you please give me

  • ITunes library not arranging songs in order

    Hi, I was wondering, on my PC, iTunes is not arranging the songs in one particular album in the correct order. (ie. like in the track order on my actual CD.) I have tried adding them to the library again, I checked that all of the tracks have a numbe

  • MM-MDM: accessing multiple namesearch

    hi gurus, currently i'm on ecc 6 + mdm 7.1 and need accessing mdm catalog via me21n screen. i've configured multiple services in mm->purchasing->environment data->web services: id and description. i have saved numbers of namesearch in mdm and need al

  • DO NOT DISCONNECT always shows on menu!

    It always says not to disconnect when plugged in to my computer. I do disconnect it after itunes says that the update is complete and the songs are always on there, but why is this? how can i fix this?