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