Manipulating report column based on another column value?

Here is what I am trying to do.
1.     I have a report region which has 2 columns.
2.     Both the columns are setup as links to navigate to a different page. I am using <img src="#IMAGE_PREFIX#e2.gif" alt="Edit"> for link text report item attribute.
3.     The value can be either in column 1 or 2 but not in both the columns at the same time.
4.     If the value is existing in column1, the column 2 should display as null, which I have trouble with. I can see the images even though the value is null.
Appreciate if you can let me know how to achieve this?
Edited by: user552288 on Jul 15, 2009 7:45 AM

Could you please post the current query which you are using?
Instead of using the image display attribute in the report attributes column, can you include that part of the query.
Something like:
select
(case when col1!=NULL then <img src="#IMAGE_PREFIX#e2.gif" alt="Edit">) else 'NULL' as Column1,
(case when col2!=NULL then <img src="#IMAGE_PREFIX#e2.gif" alt="Edit"> ) else 'NULL' as Column2
from table

Similar Messages

  • How to accessing current row report column value in Lov Query?

    Hi,
    which access methods (eg. bind variables, substitutions, ...) for getting the current row report column value can be used in the "Lov Query" property of a report column?
    As what I know of and what I have read on the forum there are no bind variables for the report columns. For the "Link Text" property it seems that the column values exist as substitution strings (#COLUMN_NAME#). But they don't work in the Lov Query. => And would be good because of a hard parse each time the Lov query is executed.
    The following post (Re: Simulating a correlated sub query in lov
    is showing a solution to use package variables for temporary storage of the referenced value, but the only problem with that solution is that if a new record is added with the "Add rows to tabular form" process the package variable still contains the value from the last queried row! Is there a way (variable, APEX package, ...) to determine if the lov query is executed for a new record so that the package can return null?
    I know that I could write the package in a way that the value is immediately cleared when lov_pkg.keyval is called (one time read), but then I would have to create several variables if I'm accessing the value multiple times in the query or in another query => I think an one time read solution would be very obscurely.
    Thanks for your help
    Patrick
    http://inside-apex.blogspot.com

    Hi Patrick,
    I agree that it's a waste to continually use Ajax to go back to the server to get the contents of a dynamic select list.
    There are no bind variables for any row item - but what you do have, as per my previous post, is the value of the data entered by the user in the first row. You can pass this into your application process (using get.add("VARIABLENAME", value)), which can use it to retrieve the correct LOV in your Ajax code - this will give you a "bind variable" that your process can use.
    What you could do, however, is generate hidden select lists on your page - one for each possible LOV list and replace the contents of the new row's select list with the contents of the appropriate hidden select list. This is easy to do with javascript (using innerHTML functions). Obviously, though, the usefulness of this depends on the number and size of the select lists.
    Even if you don't generate them to start with, you can keep a copy of any select lists returned by Ajax in the DOM for use on new rows. So, if you have retrieved a select list, you will have a copy of it in DOM which you can then copy into the new row. If you don't have the list in DOM, use Ajax to get it, store a copy of it and copy it into the new row.
    Which method you use will depend on the number/size of select lists needed. If they are few in number and/or size, I would suggest generating hidden lists. If they are large, use Ajax to get them once, store them and then retrieve them from the DOM when needed.
    There is another thread here where Arie recommends going to the server every time to make sure you get the most up-to-date data for the lists. If you want to follow this advice, for this reason, use get.add("VARIABLENAME", value) to pass the value to your process. If this is not an issue, you can use one of the other methods I outlined above.
    Regards
    Andy

  • Javascript - Referencing report column value

    Hi,
    In my application I have a report "Test" with some columns. In column "PFT_PCODE" the possible values are either 1 or 2.
    What I want is to display the report table cell in red, if the value in "PFT_PCODE" is 1, or the table cell in orange, if the value in "PFT_PCODE" is 2, respectively.
    I tried to make something in Javascript, based on a Vikas' example. I put in the
    Region Header:
    <style type="text/css">
    .rot {
    background-color: red;
    .orange {
    background-color: orange;
    </style>
    Region Footer:
    <script type="text/javascript">
    var spans=document.getElementsByTagName('span');
    for (var j=0;j<spans.length;j++) {
    if (spans[j].className=='farbe') {
    var td=html_CascadeUpTill(spans[j],'TD');
    if (document.getElementsById('#PFT_PCODE#').value == 1) {
    td.className = 'rot';
    else {
    td.className = 'orange';
    </script>
    The column "PFT_PCODE" is marked as CSS class "farbe".
    Unfortunately it's not working, I'm not sure if I reference the report column value right. Since I'm a beginner in Javascript I would be glad for help.
    I put my (reduced) application on apex.oracle.com for testing.
    Workspace: app
    Login: [email protected]
    PW: riponi
    Thanks in advance,
    Roger

    Hi Roger,
    In your report, if you do a View Source, do your report headers have id's on them - that is, the TH tags that contain the headings?
    If so, you could use:
    &lt;script type="text/javascript"&gt;
    function hilite(f1)
    var h = document.getElementById(f1);
    var t = h.parentNode;
    while (t.tagName != 'TABLE')
      t = t.parentNode;
    var rows = t.rows;
    var k;
    var j;
    var c;
    var headers = t.getElementsByTagName("TH");
    for (k = 0; k &lt; headers.length; k++)
      if (headers[k].id == f1)
        c = k;
    for (k = 1; k &lt; rows.length; k++)
      j = rows[k].getElementsByTagName("TD")[c];
      if (j.innerHTML == '2')
        j.style.backgroundColor = 'purple';
        j.style.color = 'yellow';
      if (j.innerHTML == '1')
        j.style.backgroundColor = 'red';
        j.style.color = 'white';
    &lt;/script&gt;Put that in the page's HTML Headers setting.
    In the report region's Region Footer, add in:
    &lt;script type="text/javascript"&gt;
    hilite('PFT_PCODE');
    &lt;/script&gt;This will find the heading's TH cell, work out where it is in the row, then loop through all remaining rows and check the TD cell in the same column, highlighting the cell using background and font colours.
    Andy

  • Column link - call java script & assign current report column value to item

    Hi,
    How to call java script and assing current report column value to item?
    I have a button column in the report to 'delete' the selected row.
    I want to first show dialog box with message 'Are you sure?'. If yes, process to delete
    will be executed, else no action.
    In order to fire JS, I used Column Link ->Target=URL.
    Problem: The alert is showing but I don't know how to pass selected row's primary
    key value to process (to delete selected row).
    I have a item which can be used to store selected primary key value but don't know how to assign the value
    when button pressed.
    Thanks in advance
    Dip

    Ok. The issue has been resolved by following way.
    PAGE PROCESS: delete_request
    begin
    delete xyz
    where id = :P8_id;
    commit;
    end;BUTTON URL:
    javascript: DelRec(null,'CREATE', 'f?p=&APP_ID.:8:&SESSION.:delete_request:NO::P8_id:#id#');Java Script:
    <script language="JavaScript1.1" type="text/javascript">
    function DelRec(msg, req, url){
    var confDel = msg;
    if(confDel ==null){
    confDel= confirm("Are you sure?");
    }else{
    confDel= confirm(msg);}
    if (confDel== true){
    redirect(url);           }
    </script>

  • Unable to pass report column value to url in select statement. Please help

    Hi all,
    I am trying to pass the report column value as follows:
    select key, num,
    case when Attachmentcnt(KEY) != 0 then
    'f?p=&APP_ID.:91:&SESSION.:'' '':NO::P91_KEY,P91NUM,P91_PREVPG:'And I am passing values as follows:
    {noformat}
    '#KEY#,'#NUM#','9' ELSE null
    END Attachment
    from tableA
    {noformat}
    But, I am not able to figure out correct sysntax to pass these column values. Can anyone give me some help. I appreciate it.
    rgds,
    Suma.
    Edited by: sumak on Jun 23, 2009 12:11 PM
    Edited by: sumak on Jun 23, 2009 12:22 PM

    Suma,
    If you're trying to generate a column with a URL, try something like the following:
    select key, num,
    case when Attachmentcnt(KEY) != 0 then
    'f?p=&APP_ID.:91:&SESSION.:'' '':NO::P91_KEY,P91NUM,P91_PREVPG:'
    || tableA.key || ',' || tableA.num || ',' || :P91_PREVPG
    else NULL
    end
    FROM tableA;
    But the best way to pass these would include checksum values against the values of your parameters (to make sure a user doesn't hack them). You'll need to check the Apex User manual for details - See "Understanding Session State Protection".
    Good luck,
    Stew

  • Table Control: make a field editable or not based on another field value

    HI All,
    How to make a column field input enabled or disabled based on another field value in a Table Control.
    Here's the scenario:
    I have a table control with two columns, KTOKK and LIFNR. Now for certain KTOKK, the LIFNR field should be editable and for certain KTOKK it should not be editable.
    Eg.,  KTOKK = 0001 =>  LIFNR field is not editable.
            KTOKK = ZKTO => LIFNR field is editable.
    But these fields are in a table control.
    Please advice.
    Thanks in advance,
    RK.

    Hi RK,
    Go through the below link..
    how to make special field editable or diseditable in table control?
    the code mentioned in the link.. just add ur conditions in the module....
    Best Regards,
    Brijesh

  • Search help for a field in table control based on another field value

    Hi,
    I want to attach the Search help for a field in table control based on another field value.
    Please help me asap.
    Will be highly rewarded

    HI,..
      Check these links
    search help in table control
    Re: How to create Search Help for a field in Table control !!
    How to create Search Help for a field in Table control !!
    F4 Help In Table Control
    Control table F4 help
    Problem in F4 help in screen field
    check this code
    DATA: BEGIN OF it_value4 OCCURS 0,
             TEXTCODE  LIKE  ZXX-TEXTCODE,
             TEXTDESC  LIKE  ZXX-TEXTDESC,
           END OF it_value4.
      progname = sy-repid.
      dynnum   = sy-dynnr.
             SELECT TEXTCODE TEXTDESC
               FROM  xxxx
               INTO CORRESPONDING FIELDS OF TABLE<b> it_value4</b>
              WHERE  LOSS_CODE =<b> IT_VALUE1 .</b>
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield    = 'TEXTCODE'
          dynpprog    = progname
          dynpnr      = dynnum
          dynprofield = 'ITVALUE-TEXTCODE'  "-->UR  4 th filed value in screen
          value_org   = 'S'
        TABLES
          value_tab   = it_value4.
    endmodule.
    Message was edited by:
            veereshbabu ponnada

  • Change field value in a table, based on another field value in the same row (for each added row)

    Please Help, I want to change field value in a table, based on another field value in the same row (for each added row)
    I am using this code :
    <HTML>
    <HEAD>
    <SCRIPT>
    function addRow(tableID) {
    var table = document.getElementById(tableID);
    var rowCount = table.rows.length;
    var row = table.insertRow(rowCount);
    var colCount = table.rows[0].cells.length;
    for(var i=0; i<colCount; i++ ) {
    var newcell = row.insertCell(i);
    newcell.innerHTML = table.rows[1].cells[i].innerHTML;
    switch(newcell.childNodes[0].type) {
    case "text":
    newcell.childNodes[0].value = "";
    break;
    case "checkbox":
    newcell.childNodes[0].checked = false;
    break;
    case "select-one":
    newcell.childNodes[0].selectedIndex = 0;
    break;}}}
    function deleteRow(tableID) {
    try {var table = document.getElementById(tableID);
    var rowCount = table.rows.length;
    for(var i=0; i<rowCount; i++) {
    var row = table.rows[i];
    var chkbox = row.cells[0].childNodes[0];
    if(null != chkbox && true == chkbox.checked) {
    if(rowCount <= 2) {
    alert("Cannot delete all the rows.");
    break;}
    table.deleteRow(i);
    rowCount--;
    i--;}}}catch(e) {alert(e);}}
    </SCRIPT>
    </HEAD>
    <BODY>
    <INPUT type="button" value="Add Row" onClick="addRow('dataTable')" />
    <INPUT type="button" value="Delete Row" onClick="deleteRow('dataTable')" />
    <TABLE id="dataTable" width="350px" border="1">
    <TR>
    <TD width="32"></TD>
    <TD width="119" align="center"><strong>Activity</strong></TD>
    <TD width="177" align="center"><strong>Cost</strong></TD>
    </TR>
    <TR>
    <TD><INPUT type="checkbox" name="chk"/></TD>
    <TD>
    <select name="s1" id="s1">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    </select>
    </TD>
    <TD><input type="text" name="txt1" id="txt1"></TD>
    </TR>
    </TABLE>
    </BODY>
    </HTML>

    Hi,
    Let me make sure u r working with table control.
    First u have to create a event(VALIDATE) to do the validation.
    Inside the event,
    1. First get the current index where user has pointed the curson
    2. Once u get the index read the internal table with index value.
    3. Now u can compare the col1 and col2 values and populate the error message.
    1. DATA : lo_elt TYPE REF TO if_wd_context_element,
                   l_index type i.
    lo_elt = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
         CALL METHOD LO_ELT->GET_INDEX( RECEIVING  MY_INDEX = l_index.
    above code should be written inside the event.
    Thanks,

  • URGENT:Making a poplist value freezed based on another poplist value

    Hi,
    I have a requirement to make a poplist value freezed(should get disabled so that no further change can be done) based on another poplist value.
    for ex : poplist 1 : A,B.
    poplist2: yes,no
    if A is selected, yes,no should appear in the poplist2.
    if B is selected, only YEs should appear in the poplist2 and it should get greyed out(disabled for further changing).
    Please help.
    Thanks,
    Veena.
    Edited by: Veena. on Dec 31, 2012 4:00 AM

    Veena,
    there is nothing urgent on this forum!
    You know that you should provide your jdev version so that we can help you solve your problem.
    Next it would help if you provide the code (of the page) so that we see how you setup the 'poplist' (whatever that exactly is).
    If you mean a selectOnceChioce you can implement a valuechangeListener on poplist A and depending on the new value set the value of poplist B to yes and disable it.
    Timo

  • Filter the report based on the parent report column values

    Hi,
    period --- jan12 feb12 mar12...
    tickets --- _3_ _10_ _16_ .....
    This is my report layout.When i click on the no.of total tickets 3/10/16.It need to navigate to another report which should be filtered based on the reporting period as well as total tickets.
    How can i achieve this requirement.Is there any possibility to pass the column values from one report to another report?
    I tried "filter based on the another request" but it not worked for me.
    The summary of the requirement is when i click on 3 it need to display the 3 tickets details only...
    Anyone please help me out.
    thanks,
    prassu

    If your query means that for Jan 12 there are 3 tickets and for Feb 12 there are 10 tickets in the database, then you should only need to make the Period Column Is Prompted in the detail report. If the action link is not working this way then something else is wrong. Is the detail made from the same subject area?

  • How to refresh a report column value alone.

    Hi All,
    If we have a static report and for one of the columns of report, if I need to give a feature to click on it and a popup appears and there is a checkbox to select values on that popup page and finally after making changes and I press on apply changes, It should close the popup window and then come and change the value of that column alone in original report instead of refreshing the whole page.
    The column of the report is of type "Standard Report Column".
    How can I achieve this functionality?
    Thanks & Regards,
    Vikas
    Edited by: Vikas Krishna on Sep 29, 2009 9:47 PM

    Vikas,
    I slightly modified on of my older examples and you will find everything here:
    http://apex.oracle.com/pls/otn/f?p=31517:241
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    ------------------------------------------------------------------------------

  • Update tabular report column value using AJAX

    Hi,
    I'm developing an online store application whereby I would like the user to be able browse a list of products (tabluar report), enter an order quantity against a product and click a 'Buy' button (column link). This should then update a collection with the selected product id and order quantity. However, I'm struggling with how to update the order qty column value.
    See http://apex.oracle.com/pls/otn/f?p=33248:1 for an example
    The report displays the products from demo_product_info table. I have an additional column in the report SQL for the order quantity (set to '1').
    I'm using a column link on the product_id column that sets
    P1_TEMP_PRODUCT_ID = #PRODUCT_ID#
    P1_TEMP_QTY = #QTY_ORDERED#
    then re-renders the page.
    I have a page rendering process that takes the values from the temp items and updates a collection.
    When the user changes the order quantity, how do I update session state so the new value is picked up by the column link?
    Thanks,
    Andrew.

    To update session state you might check out this article titled, "ApEx: Setting session state from within a PL/SQL Package/Procedure/Function" at http://atulley.wordpress.com/2007/05/17/apex-setting-session-state-from-within-a-plsql-packageprocedurefunction/
    It says:
    The answer lies in the set_sesssion_state procedure found in the APEX_UTIL package. E.g.
    APEX_UTIL.set_session_state(
    p_name => ‘PX_MY_ITEM’
    , p_value => ‘wibble’);
    Now, I have a question for you. Once you set the value of the column in session state, how will you make that value be put in the database?
    Thanks, Maggie

  • How to pass report column value

    I'm trying to implement a AJAX report pull from one of the response on this forum. The report column calls the following javascript function below. The #COL2# values are dotted values like 10.2.3.5.6. The function passes values correctly passed if the values are without special characters. I tried to put the value 10.2.3.5.6 in escape(10.2.3.5.6), but didn't work. Any ideas to pass this value in javascript encode/decode way is appreciated.
    javascript:GetReport(#COL02#)
    thanks,
    Surya

    Hello Surya,
    >> I have put an example on APEX site …
    This is indeed the best and fastest way to get help.
    >> but the third version value "1.2.3" fails to display …
    String parameters should be encapsulated with single/double quote signs.
    Your first two rows could have been considered as numbers, so the systems let them pass. The third one – 1.2.3 – is not a number, but you didn’t mark it as a string.
    I changed your code to the following:
    javascript:GetReport_r1('#COL01#');And now it’s working as you need.
    General remark: I saw in your report page that you are using the “Generic Column Names”. Just so you know, this not is the optimal choice. If you don't have to use it, you should use the first option of “Query Specific Column name”. If you have to use generic columns, try to minimize the number as close as you can to the real number of columns, and not just to default of 60.
    Regards,
    Arie.

  • Value for a parameter based on another parameter value

    Hi all,
    i am using report 6i and 10g db.
    I have to create a report based on some parameter values. For example
    Two parameter named as P_emp_code and P_emp_name
    In the first parameter p_emp_code has list of values like empcode emp_full_name ie like 0002108 Vanitha Lanet Mendez
    when user select P_emp_code i want to display the fullname in p_emp_name .
    I tried as follows in list of values
    select emp_fullname from emp_master where emp_code=:p_emp_code
    then getting error bind variable cannot be used
    Please suggest a way .
    Thanks
    Rincy

    Hello,
    The thing you are asking for set and editing the reports parameter form's value. Then i don't think you can do this by using the report parameter form.
    But there are two alternatives for this task.
    1. Create one form using form builder and pass the parameter and run the report from there. So, you can use the code as you showed in your first post.
    2. Why don't you make this Title setting automatically? I Mean using the gender column (with decode/case condition) of same table.
    -Ammad

  • Unable to filter LookupSet values based on another Lookup value

    Hey all, I've got a report item where I'm pulling a list of values using a lookupset. The lookupset is working as expected, however I need to filter those results based on a different value which belongs to the same dataset as the lookup value. I'm trying
    to filter on the tablix but nothing I try is working to filter. I just end up with no data when I know I should be getting one value. I tried filtering using a lookup and lookupset expression but that doesn't seem to be what is needed. This is my first time
    really diving into lookups so any help would be appreciated.
    Thanks,
    Bryan
    (using report builder 3.0)

    Do you only want the values where type = "Writing Assignment 1". If that is the case then modify your LookupSet as follows:
    =Join(Lookupset(Fields!identifier.Value+"Writing
    Assignment 1",Fields!Student.Value+Fields!value.Value,
    Fields!value.Value, "Comments"), vbCrLf)
    This will require that identifier matches student and type matches "Writing Assignment 1".
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

Maybe you are looking for

  • Modbus Slave Demon - Executable cannot find VI.

    I have included in my application Modbus Ethernet Example Slave, which I've altered a bit ( only the inside of While Loop ). Everything is working fine until I've come to using an executable built from my project. When I start it I got: Error 7 occur

  • For each loop not working

    My trace statements inside my for each loop won't show. Please someone check my code. I"m getting no errors in flex builder. When i debug all vars are holding prober data. Thanks so much

  • Make a circle with outline and image

    Hi All I am trying to make an image in the shape of a circle, with a border, kind of like the image attached, but i need the black boarder to be even, and ideally need it to be a template so the circle and boarder is the same size and i just add diff

  • Link with Work Centre and Order Number?

    Can anybody give me a link between the Work center(CRHD-ARBPL) and Order Number(AUFK-AUFNR)? Regards, Subhasish

  • Steps to migrate 2005 SSRS reports into 2012 SSRS?

    Hi All, I will migrate bunch of datamarts from 2005 to 2012 SO Any idea where should I start looking and steps to take for SSRS reports? thanks, Gok