【问题标题】:IcCube Reporting, Conditional coloring a RowIcCube 报告,条件着色一行
【发布时间】:2017-05-03 16:35:07
【问题描述】:

使用 IcCube 报告 V6,我知道如何根据值对列(或列列表)中表格的单元格进行条件着色。

有没有办法根据标签有条件地为整行着色? 例如,如果标签是“服务器”或者可能只有该行的值,我想将该行涂成红色。

我想起点是使用“Ad-Hoc Expression”类型的Cell Renderer,但我不知道怎么写。

【问题讨论】:

    标签: adhoc iccube-reporting


    【解决方案1】:

    在 IcCube 6.2 中有几种方法可以做到这一点:

    即席表达

    有可能使用表达式作为过滤函数来将整个单元格渲染器应用于单元格/行/列

    在这种特定情况下,您可能想要使用(它需要完全 "true" 字符串):

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

    icCube 6.2 (4217)+

    返回值可以是"true"true

    return context.rowLabel() == 'Server'
    

    Demo report


    色彩表现

    如果您的唯一目标是更改所选单元格/行/列的背景/文本颜色,您可能需要使用颜色表达式:

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

    【讨论】:

    • 感谢@Artem,我会在 6.2 可用时尝试。
    猜你喜欢
    • 2011-11-09
    • 1970-01-01
    • 1970-01-01
    • 2015-06-14
    • 1970-01-01
    • 2017-05-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多