adhociccube-reporting

IcCube Reporting, Conditional coloring a Row


Using IcCube reporting V6, I know how to conditionally color cells of a table in a column (or list of columns) depending on their values.

enter image description here

Is there a way to conditionally color a complete row depending on its label?

For example, I'd like to color the row in red if it's label is "server" or maybe only values for this row.

enter image description here

I guess the starting point is to use a Cell Renderer of "Ad-Hoc Expression" type, But I don't know how to write it.

enter image description here


Solution

  • There are couple of ways to do so in IcCube 6.2:

    Ad-Hoc Expression

    There is possibility to use expression as a filter function to apply whole cell renderer to a cell/row/column

    In this specific case you might want to use (it expects exactly "true" string):

    return context.rowLabel() == 'Server' ? 'true' : 'false'
    

    icCube 6.2 (4217)+

    Return value could be "true" or true:

    return context.rowLabel() == 'Server'
    

    Demo report


    Color Expression

    If your only goal to change a background/text color of a selected cell/row/column you might want to use color expression :

    if(context.rowLabel() == 'Server'){
        return "#f2a2a5"
    }
    
    return null
    

    enter image description here