Bertrand Miot
Bertrand Miot

Reputation: 929

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

Upvotes: 1

Views: 51

Answers (1)

Artem Lopatiy
Artem Lopatiy

Reputation: 938

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

Upvotes: 1

Related Questions