Variable Expression: express
the function used to define the variable value, it can be composed of more fields and variables, and could be used logic operators, math operators and so on. To easly define the expression an expression editor is provided in Jaspersoft Studio, this can be opened using the button at the right of the text Field used to write the expression. The expression is evaluated on each iteration, every time a record is readed from the datasource. If there isn't a calculation function defined (this will be explained below) the result of the expression will be assigned to the variable, so it's important that the result has a type compatible with the one in the variable. ide
每次读取一条记录,Variable Expression的表达式就会执行一次,若是CALCULATION没有定义,那么Variable Expression的表达式计算出来的值就是本次变量的值。若是CALCULATION有定义,那变量的结果是合计后的值。Increment Type : 优化
when a calculation function is defined, the the value of the expression is passed to the function that will do the calculation for the variable.
Increment Type是为CALCULATION定义的。
1. RESETTYPE 定义变量何时重置为初始状态
2. CALCULATION 定义变量的合计方式。
3. INCREMENTTYPE 定义CALCULATION所描述的合计方式何时计算一次,传入的值是Variable Expression计算出来的值。
4. Variable Expression 定义每次计算的时候该怎样计算,每取一条记录执行一次。 this
RESETTYPE下各个选项意义:
None : 对于每条记录都会从新计算一次,一个group中可能有n条记录。
Report :变量只重置一次,且是在报表起始的时候重置。
Page : 在每一个页面起始的时候重置。
Group : 一个分组重置一次。
Column : 还不清楚,暂时发现跟Page是同样的功能。可是column的定义是在每一页列开始的时候重置。 暂时不知道怎么用。
INCREMENTTYPE各个选项意义:
Column : 对于CALCULATION定义的合计方式,每列后从新计算一次。
Group : 对于CALCULATION定义的合计方式,每个分组从新计算一次。
None : 对于CALCULATION定义的合计方式,每读取一条记录从新计算一次。
Page : 对于CALCULATION定义的合计方式,每页结束从新计算一次。
Report : 对于CALCULATION定义的合计方式,只从新计算一次,而且是在报表的结束从新计算。 lua