IcCube 报告,有条件地为一行着色
IcCube Reporting, Conditional coloring a Row
使用 IcCube 报告 V6,我知道如何根据它们的值对列(或列列表)中 table 的单元格进行条件着色。
有没有办法根据标签有条件地为整行着色?
例如,如果它的标签是 "server" 或者可能只有该行的值,我想将行涂成红色。
我猜起点是使用"Ad-Hoc Expression"类型的Cell Renderer,但是我不知道怎么写。
在 IcCube 6.2 中有几种方法可以做到这一点:
临时表达式
可以使用表达式作为过滤函数,将整个单元格渲染器应用于 cell/row/column
在这种特定情况下,您可能想要使用(它需要 "true" 字符串):
return context.rowLabel() == 'Server' ? 'true' : 'false'
icCube 6.2 (4217)+
Return 值可以是 "true" 或 true:
return context.rowLabel() == 'Server'
色彩表达
如果您的唯一目标是更改所选 cell/row/column 的 background/text 颜色,您可能需要使用颜色表达式:
if(context.rowLabel() == 'Server'){
return "#f2a2a5"
}
return null
使用 IcCube 报告 V6,我知道如何根据它们的值对列(或列列表)中 table 的单元格进行条件着色。
有没有办法根据标签有条件地为整行着色? 例如,如果它的标签是 "server" 或者可能只有该行的值,我想将行涂成红色。
我猜起点是使用"Ad-Hoc Expression"类型的Cell Renderer,但是我不知道怎么写。
在 IcCube 6.2 中有几种方法可以做到这一点:
临时表达式
可以使用表达式作为过滤函数,将整个单元格渲染器应用于 cell/row/column
在这种特定情况下,您可能想要使用(它需要 "true" 字符串):
return context.rowLabel() == 'Server' ? 'true' : 'false'
icCube 6.2 (4217)+
Return 值可以是 "true" 或 true:
return context.rowLabel() == 'Server'
色彩表达
如果您的唯一目标是更改所选 cell/row/column 的 background/text 颜色,您可能需要使用颜色表达式:
if(context.rowLabel() == 'Server'){
return "#f2a2a5"
}
return null