Value Class Name类型:必需,因为变量是可能在其他表达式中使用的对象,因此必须知道其类型才能正确操作。
•
Expression表达式:用于定义变量值的函数,它可以由更多的字段和变量组成,可以是逻辑运算符、数学运算符等。Jaspersoft Studio 提供了一个表达式编辑器。要打开它,请单击表达式文本字段右侧的按钮。在每次迭代(每次从数据源读取记录)时计算表达式。如果未定义计算函数,则表达式的结果将分配给变量。因此,结果的类型必须与变量中的类型兼容。
Sum: At every iteration, the variable value is summed. This is one of the cases where the initial value is really important. Sum:在每次迭代时,对变量值进行求和。这是初始值非常重要的情况之一。
•
Count: At every iteration, the variable value is incremented by one unit (this is only if the expression is not null). 计数:每次迭代时,变量值都会增加一个单位(仅当表达式不为空时)。
•
Distinct Count: At every iteration, the variable value is incremented by one unit, but only if the value of the expression was never returned before. 不同计数:在每次迭代时,变量值都会增加一个单位,但前提是表达式的值以前从未返回过。
•
Average: The value of the variable is the arithmetic average of all values received in input from the expression. 平均值:变量的值是从表达式输入中接收到的所有值的算术平均值。
•
Lowest: The variable takes the value of the lowest element received from the expression. 最低:变量采用从表达式接收的最低元素的值。
•
Highest: The variable takes the value of the highest element received from the expression. 最高:变量采用从表达式接收到的最高元素的值。
•
Standard Deviation: The standard deviation of all the values received from the expression. 标准差:从表达式接收到的所有值的标准差。
•
First: The variable takes the value from the first value returned by the expression. First:变量从表达式返回的第一个值中获取值。
•
System: No calculation is done and the expression is not evaluated. The value of the variable is the last value set on it. This is useful to store partial results or the final results of a computation. 系统:不进行任何计算,也不对表达式求值。变量的值是最后设置的值。这对于存储部分结果或计算的最终结果很有用。
•
Variance: The variance of all values returned by evaluation of a report variable’s expression. 方差:通过计算报表变量表达式返回的所有值的方差。
•
Increment Type 增量类型。
该属性的可能值为:
•
Report: The Calculation Function is called only at the end of the report, passing it to the expression's value at that moment. 报告:仅在报告末尾调用计算函数,并将其传递给当时表达式的值。
•
Page: The Calculation Function is called at the end of each page, passing to it expression's value at each of those moments. 页面:计算函数在每页末尾调用,在每个时刻向其传递表达式的值。
•
Column: The Calculation Function is called at the end of each column (for a one-column report, this is the same as Page). 列:在每列的末尾调用计算函数(对于单列报表,这与页面相同)。
•
Group: The Calculation Function is called at the start of every occurrence of the specified group. This option is visible only if at least one group is defined. 组:在每次出现指定组时调用计算函数。仅当至少定义了一组时,此选项才可见。
•
None: The Calculation Function is called after the read of every record, this is the default behavior. None:读取每条记录后调用计算函数,这是默认行为。
•
Reset Type 复位类型: 重置类型指定变量何时应重置为其初始值(如果未定义初始值,则重置为 null)。当变量用于计算部分值(例如仅读取的某些记录的总和或平均值)时,这非常有用。
该属性的可选值为:
•
Report: The variable is initialized only one time at the beginning of the report creation. 报告:该变量仅在报告创建开始时初始化一次。
•
Page: The variable is initialized on each page. 页面:变量在每页上初始化。
•
Column: The variable is initialized again in each new column (for a one-column report, this is the same as Page). 列:在每个新列中再次初始化变量(对于单列报表,这与页面相同)。
•
Group: The variable is initialized at the start of every occurrence of the specified group. This option is available only if at least one group is defined. 组:变量在每次出现指定组时初始化。仅当至少定义了一组时,此选项才可用。
•
None: The variable is never initialized, so the initial value expression is ignored. None:变量从未初始化,因此初始值表达式被忽略。