开发者

BIRT: creating custom dataSetRow / using dataSetRow in js

开发者 https://www.devze.com 2023-01-28 08:50 出处:网络
Scenario I have some report with groups Mark && Customer (String) price - is decimal, id is int

Scenario I have some report with groups Mark && Customer (String) price - is decimal, id is int


| Mark | [price] | {expresion} | //in price in group of Mark

| Customer | [id] | |


price has aggregateOn Mark and aggregateFunction SUM

in {expresion} I need to show rounded value of [price] with next rule(script on render) :

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

dataSetRow["PRICE"] have all price`s. but I need only those who is in group Mark somtink like grouped(dataSetRow["PRICE"],"Mark")

Questions : 1: How to do this in javascript fu开发者_Go百科nction? 2: If it is not possible , how to do this by another way ? Thank you.


I'd try to write a javascript function in the initialize method of the Report Design. passing the parameter "Price"

// inizialize
function myRoundCheck(obj,price) {
  if( Total.sum(BirtMath.round(price)) != BirtMath.round(Total.sum(price)) ) {
    obj.getStyle().color ='$COLOR$';
  }
}

// on render
myRoundCheck(this,dataSetRow["PRICE"]);
0

精彩评论

暂无评论...
验证码 换一张
取 消