【问题标题】:BIRT: creating custom dataSetRow / using dataSetRow in jsBIRT:在 js 中创建自定义 dataSetRow / 使用 dataSetRow
【发布时间】:2010-12-01 16:22:14
【问题描述】:

场景 我有一些关于 Mark && Customer 组的报告(字符串) price - 是十进制,id 是 int


|马克 | [价格] | {表达式} | //在标记组中的价格

|客户 | [编号] | |


price 有 aggregateOn Mark 和 aggregateFunction SUM

在 {expresion} 中,我需要使用下一条规则(渲染脚本)显示 [price] 的四舍五入值:

if(
Total.sum(BirtMath.round(dataSetRow["PRICE"])) != BirtMath.round(Total.sum(dataSetRow["PRICE"])) )
{
 this.getStyle().color ='$COLOR$'
}

dataSetRow["PRICE"] 包含所有价格。但我只需要马克组中的人 somtink like grouped(dataSetRow["PRICE"],"Mark")

问题: 1:如何在javascript函数中做到这一点? 2:如果不可能,如何通过另一种方式做到这一点? 谢谢。

【问题讨论】:

    标签: java birt


    【解决方案1】:

    我会尝试在报表设计的初始化方法中编写一个 javascript 函数。 传递参数“价格”

    // 初始化 函数 myRoundCheck(obj,price) { if( Total.sum(BirtMath.round(price)) != BirtMath.round(Total.sum(price)) ) { obj.getStyle().color ='$COLOR$'; } } // 渲染时 myRoundCheck(this,dataSetRow["PRICE"]);

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多