Coloring individual table rows based on a condition

Hi Experts,
I have a table bound to a node in the context via datasource property.
I was trying to color an individual row based on a certain value in the context node.
Can anyone help my achieve this please?
For example:
for( int i=0; i<table.size(); i++)
    if(wdContext.tableNode().getTableElementAt(i).getFieldA().equals("Y"))
        // then color the table row
Any suggestions?
M

Solved.

Similar Messages

  • Need to  color a Table row based on a Column value

    Dear Alll
    I have a requirement to color the rows of a table based on a column value in it. I have tried and surfed many useful materials over the net. but none of them solves my purpose. Please help me, I know that i can used OADataBoundValueViewObject and create a custom css file and apply color to a particular column of a table using a decode in the select statement of that VO.
    But all i need is to color a particular row with a particular color. Need your help with this ........
    Please do reply
    Best Regards
    Edited by: Antony Jayaraj on Mar 27, 2012 8:54 PM

    These posts might help you.
    How to change the row color based on Condition
    Can we colour the rows in the column of a table
    Regards,
    Peddi.

  • Getting error while setting color to table rows?

    Hi All
    I am trying to setting colors to table rows based on dropdown value.
    lv_Dropdown vaue =1 i want to set one color, 2-another color like that.
    For this I create attribute CELL_DESIGN of type WDUI_TABLE_CELL_DESIGN in node, and i bind this attribute to every column celldesign property in table. and my code in on select of dropdown.
      data lr_column type ref to cl_wd_table_column.
    data:obj_table type ref to cl_wd_table.
    lr_column = obj_table->get_column( id = 'TABLE_WEEK1' ).
    if lv_dropdown = 1.
       lr_column->set_cell_design(
    cl_wd_table_column=>e_cell_design-badvalue_dark ).
    endif.
    lr_column->bind_cell_design( path = 'SEGMENT1.CELL_DESIGN'  ). ...Giving dump at r_colum = get_column( )
    I follow correct code or not??
    Cheers,
    Venkys.

    Sorry Sarbjeet and baskaran i am not getting,
    I want to set colors to row of a table on dropdown selection. In dropdown i ahve a code like
    DATA lo_nd_segment1 TYPE REF TO if_wd_context_node.
      DATA lo_el_segment1 TYPE REF TO if_wd_context_element.
      DATA ls_segment1 TYPE wd_this->Element_segment1.
      data lt_segment1 type wd_this->elements_segment1.
      DATA lv_segment TYPE wd_this->Element_segment1-segment.
    navigate from <CONTEXT> to <SEGMENT1> via lead selection
      lo_nd_segment1 = wd_context->get_child_node( name = wd_this->wdctx_segment1 ).
    get element via lead selection
      lo_el_segment1 = lo_nd_segment1->get_element( ).
      lo_el_segment1 = WDEVENT->GET_CONTEXT_ELEMENT( 'CONTEXT_ELEMENT' ).
    get all declared attributes
      lo_el_segment1->get_static_attributes(
        IMPORTING
          static_attributes = ls_segment1 ).
    DATA : lv_dropdown type string .
    lv_dropdown =  ls_segment1-segment.
    if lv_dropdown = 1.  SET ONE COLOR TO THAT ROW
    endif.
    if lv_dropdown = 2.  SET ONE COLOR TO THAT ROW
    endif.
    Now what should be the code in WDMODIFYVIEW method to set table row with colors.
    Cheers,
    Venkys.

  • Highligting rows based on multiple conditions

    Hi,
    I have to show a report with exceptions highlighted in RED color. Exceptions are based on some conditions:
    If I have four columns in an answer request, two of which say "Level" and "Status".
    based on the "Level" and "Status" column conditions I have to highlight entire row which satisfies any of the condition.
    Ex: If I have Level=3,4,5 and Status= Y,N then for
    Level=3 or Status=N is one exception.
    Level=4,5 or Status=Y is another exception.
    Based on this two column conditions I have to highlight entire row in the report.
    Can we do this in OBIEE. Highlighting rows based on multiple conditions?
    Thanks in advance!

    Thanks for the reply.
    I have tried that already. I can highlight one specific field but not entire row.
    If I keep on applying the conditional format for the other columns too then I can't apply the conditions.
    Anyways, I have created a dummy column with the conditions in it and then applied that to the other fields and used conditional format to highlight the color.

  • Trying to alter font on a report row based on data condition

    Hello.
    I have an Apex application with a "classic" SQL report and a corresponding form.
    In the report region I am pulling all items from a table (Select * from TASKS)
    The TASKS table contains many columns including DUE_DATE and COMPLETE_DATE field.
    I am trying to find a way to format the rows in my report based on the condition of those two fields.
    If the record has a complete_date (not null) then I want to change the font for the entire row (each column) to be grey.
    If the record does not have a complete_date (null) and due_date is before today, I want the row to be bold and red.
    Otherwise, the row would display standard black text.
    I can't seem to find a straightforward way to do this in Apex.

    Hi JodyMorin,
    Try looking at this post:
    Conditional item formatting (color)
    You will need to tweak the code a bit for your needs, but I hope it helps.
    -Marc

  • Color a table row

    Hello community!
    I'm using a table in a view, and I'd like to color some rows depending on a condition value.
    I've found some tips for coloring a row when using an ALV, but that's not my case.
    How could I do that?
    Thanks for any help =)
    Have a great day =)
    C.

    Hi,
    In this link -
    Re: How to make Row of a table Editable. -check Manoj's reply
    they have used READ_ONLY to edit but you can use the same coding but replcae that READ_ONLY with the WDUI_TABLE_CELL_DESIGN type. Replace READ_ONLY as CELL_DESIGN.
    Write the code in the WDODOMODIFY View and get the table reference.
    In the LOOP.....
    if....
    cell_design = '01'.
    else.
    cell_design = '02'.
    endif.
    ie
    LOOP AT lt_node INTO ls_node.
    IF sy-tabix = lv_index.
    ls_node-cell_design = '01'.
    ELSE.
    ls_node-cell_design = '02'.
    ENDIF.
    MODIFY lt_node INDEX sy-tabix FROM ls_node TRANSPORTING cell_design.
    ENDLOOP.
    Is this clear....
    Regards,
    Lekha.

  • Color of Table row

    I created a table at design time and binded data from model. I want to change tables first row to red color. I tried to change at design time but all rows colour are being changed.
    Can any one tell me how to do it?

    Hi,
    Create a value attribute "cellEditorColor" under the table node  of type com.sap.ide.webdynpro.uielementdefinitions.TableCellDesign.
    Map the attribute "cellEditorColor" to "cellDesign" property of all the table column.
    To set the color of the row in the table
    IPrivate<your view>.ITableNodeElement ele = wdContext.nodeTableNode.getTableNodeElementAt(<row index>);
    ele.setcellEditorColor(WDTableCellDesign.BADVALUE_DARK);
    This works irrespective of type of cell editor in the column.

  • Calling two table controlls based on some conditions......

    I hav a requirement in which i have two table controlls, which i want to call based on some conditions. Like if condition is satisfied the first table controll shud fill up the screen and other wise the secondtable controll shud fill the screen....

    Hello,
    In the main screen where u need to vary with the 2 table controls , create a subscreen area .
    Now create two subscreens with the required table controls respectively.
    You can dynamically call the subscreens accordingly for  the conditions.
    Hope this may help you.
    Neeraj

  • Conditional coloring in table row

    Hi,
    I want to show some table cells highlighted with some colors.for different condition.For example if status is active then show in green otherwise show in red.
    How can i achieve ?

    User, please tell us your jdev version!
    The way to go is to point the inline style of the component (or the style class if you have a css defined for the different colors) to a bean method. In the bean method you calculate the right color or style for the cell and return it. The bean method can access the other attributes of the current row rendered to get to the right result.
    In some easy cases you can use a ternary EL to get to the right color like
    #{row.value > 0 ? green : red}
    which will color all positive numbers in the cell green and all negative numbers red.
    Timo

  • How to make a table column block editable for a row and remain non editable for other row based on some condition

    hi ,
    i need help on the below scenario ,
    we have a web dynpro table with different columns, now based on new business requirement  one of the column need to     
    dynamically editable or non editable for different row.
    for ex :
    Field 1
    Field 2 ( Dynamic field )
    Field 3
    Field 4
    Data 11
    Data 12 ( Editable with Drop down   )
    data 13
    data 14
    Data 21
    Data 22 ( Non editable )
    Data 23
    data 24
    Data 31
    data  32 ( Editable with drop down )
    data 33
    data 34
    how to achieve this ? please help on this.
    Thanks in advance
    Thanks
    Manish

    Manish,
    there is no proper way to insert two Cell Editors in a column(except variants), have a look on below scenario, it may help.
    add one more attribute to your table context node for read-only.
    create dropDown as celleditor for table and bind with newly created attribute to read-only property of dropdown.
    before binding data to table, check the condition then mention readonly value abap_true / false.
    @ we can achieve by the use of Variants.
    for ex :
    Data 11
    Data 12 ( Editable with Drop down)
    data 13
    read-only - abap_false
    Data 21
    Data 22 ( Non editable, dropdown )
    Data 23
    read-only - abap_true
    Data 31
    data  32 ( Editable with drop down )
    data 33
    read-only - abap_false

  • Create a number of sub reports or table rows based on an arbitrary number

    I should note that I am using reporting services in SharePoint server mode and I am connecting to Sharepoint list data as my data source.
    In my SharePoint list item, it will have a property called quantity with a value of 5 for example.  In this case, I would want to create 5 subreports in my report (or a table with 5 rows).  Currently, I do not see how to accomplish this using Report
    Builder.  The table will only display a number of rows equal to the number of items returned from a dataset, which in this case would be 1.
    Is this possible to do?

    Katherin earlier said "In your scenario, you can insert 4 rows in the table, then insert values". 
    How do you do that?  That's the piece I don't understand.
    sqlstudy, below I have included more background on the requirements and details of what we are trying to do.  Here is another example of the dataset:
    Name____
    Description____
    Quantity
    Item1
    Tennis Balls
    2
    Item2
    Footballs
    3
    The requirement is that we need to print 5 pieces of paper that each have the item's name and description as well as an x of y sequence based on the quantity.  So the first piece of paper that prints out would say (Item1,Tennis Balls, 1 of 2), the second
    piece of paper would say (Item1,Tennis Balls, 2 of 2), the third piece of paper would say (Item2,Footballs, 1 of 3), the fourth piece of paper would say (Item2,Footballs, 2 of 3), and the fifth piece of paper would say (Item2,Footballs, 3 of 3).
    We are creating a system where users can print labels to identify boxes on pallets.  Each pallet can contain multiple boxes and the users need to label and identify each box.  The x of y sequence helps them keep the boxes together so things don't
    get mixed up.  The users deal with a lot of orders at once and would like to be able to print everything at once.  So, given the dataset above, they would check both item1 and item2, press print and expect to get the 5 pages as I described earlier.

  • Coloring a table row

    I have a scenario in which i populate data in table ui thru Rfc call.Now I select a particular row then on clicking of a button the row color should change.how do i change colors of a particular row at runtime?
    Note:dont not post blogs of colorful tables.
    regards
    Nikhil Tapkir

    Hi Nikhil,
    Check out this link
    http://help.sap.com/saphelp_nw04/helpdata/en/0e/23b3c8b0a238439f664f73a04e6332/frameset.htm
    Thanks
    Anup

  • Disable a field in a Table layout based on the condition

    Hello,
    In the seeded page, there is a table layout region with viewobject name as View1. It has 3 fields displayed as Field A, Field B, Field C with multiple rows displayed when the page opens. Fields B and C are MessageTextInputs and Field A is MessageChoice. So in the displayed rows in the table, if the value selected in the Field A is "Bonus" then the fields B and C needs to be disabled so that the user should not be able to enter any information. So if there are 5 rows in that table, only 1 or 2 rows might have the value "Bonus" in the field A and only for those rows, fields B and C needs to be disabled.
    I would appreciate if anyone can provide me with a logic. I know how to disable a field based on the value of other field but in this case here, its a table region with multiple rows and only few of them needs to be disabled. I couldn't think of any logic here. Any help is greatly appreciated.
    Thank You
    KK

    Similar problem
    Re: How to make Advanced table readonly

  • Suppressing rows based on a condition

    I have report, where I have to remove certain rows out of the report, based on the certain condition.
    Note that, there are two characteristics in the rows, and one key figure in the columns. If the first characteristic value equals that of the second characteristic in the rows, I want to remove that row from display.
    Row1              R1    R2      K1
    Row2              R3    R3      K1
    Row3              R2    R3      K1
    Row4              R3    R2      K1
    In the above example, I need to remove Row2, because both characteristics have same value, which is R3. I want to suppress those records, and just show Row1, Row3 and Row4.
    Row1              R1    R2      K1
    Row2              R3    R3      K1  ->  remove this row
    Row3              R2    R3      K1
    Row4              R3    R2      K1
    My problem is conditions only work on the key figures, not characteristics. I tried the replacement variables, but it is not working.
    Any ideas?

    Hi,
    You can achieve the solution if your 2 characteristic's data type is NUMC.
    If it is NUMC, then try the below steps:
    1. Create a formula in the Key Figures structure.
    2. In the formula, create a formula variable, and on the formula variable select the processing type as Replacement Path. After that choose the first characteristic on the Characteristics selection.
    3. Repeat step 2 again for second characteristic.
    4. Now the two formula variables contains two characteristic. Select both of them and subtract it.
    5. You will get the values 0 and not equel to 0.
    6. Create a condition and suppress zero values of the formula key figure.
    If it is not NUMC, then i guess you have to stage the data to another location. At the time of transformation you have to supress the records.
    Vivek

  • How do i export the table data based on some condition for backup

    Is is syntax correct
    exp scott@orcl92 file=emp_29aug.dmp tables=emp
    query=\"where emp_no in (1,2,3,4) \".
    How do i take the backup of more than one table?
    what is the syntax for that
    Thans

    Thanks for your response
    If i want to add more than one condition in the query, then how do i do that
    exp scott/tiger@orcl file=scott.dmp tables=(emp, dept) query=\"where deptno = 30\" and emp_no in (1,2,3,4);
    how do i do that

Maybe you are looking for

  • Re: Tecra Z40, Win 8.1 - Fingerprint reader malfunction

    PROBLEM DESCRIPTION: My Tecra Z40 arrived with Win 8.1. From the start I could not use the Fingerprint Utility. When accessing the utility nothing would happen for a moment and then the error: 'Could not connect to the fingerprint reader' eventually

  • How to install Photoshop CS6 Extended for Mac with no DVD drive?

    I have bought the Photoshop CS6 Extended for Students for my new Mac and realized that I don't have a DVD drive to install it on. Is there a way that I can install the program without the cd? I have looked into the "free trial then activate" route an

  • Capturing in FCP6 from XH A1 in 24p please help

    Hi, I'm using my new final cut studio 2 to copture from Canon XH A1. I shot some footage in DV SP 16:9 in 24f. When I capture my footage it appears very blurry, many lines are washed out and it looks like a bad footage. Now, I've watched the same on

  • Variance calculation repport (KKS2) different to variance line items (KOB3)

    Hi, need your help. I´ve run variance calculation (KKS2) for one production order, one target cost version and it has calculated correctly all cost element variances. However, when I display variance line items (KOB3) for this order with the same tar

  • Tablespace autoextend on multiple datafiles

    There is a tablespace with 3 data files, one of them having AUTOEXTEND option ON. I am trying to understand why space is not allocated on datafile with AUTOEXEND option ON. Thanks in advance..