|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface JRVariable
An interface for implementing classes that deal with report variables. This interface defines constants for names of built-in variables and for reset, increment and calculation types.
When declaring a report group, the engine will automatically create a count variable that will calculate the number of records that make up the current group (number of records processed between group ruptures). The name for this variable comes from the name of the group it corresponds to, suffixed with the "_COUNT" sequence. It can be used like any other report variable, in any report expression (even in the current group expression like you can see done in the "BreakGroup" of the jasper sample).
Field Summary | |
---|---|
static byte |
CALCULATION_AVERAGE
The value is obtained by calculating the average for the series of values obtained by evaluating the variable's expression for each record in the data source. |
static byte |
CALCULATION_COUNT
The value is calculated by counting the non-null values of the variable expression with every iteration in the data source. |
static byte |
CALCULATION_DISTINCT_COUNT
The value is calculated by counting the distinct non-null values of the variable expression with every iteration in the data source. |
static byte |
CALCULATION_FIRST
The variable keeps the first value and does not increment it on subsequent iterations. |
static byte |
CALCULATION_HIGHEST
The value of the variable represents the highest in the series of values obtained by evaluating the variable's expression for each data source record. |
static byte |
CALCULATION_LOWEST
The value of the variable represents the lowest in the series of values obtained by evaluating the variable's expression for each data source record. |
static byte |
CALCULATION_NOTHING
The value is calculated by simply evaluating the variable expression. |
static byte |
CALCULATION_STANDARD_DEVIATION
The value is obtained by calculating the standard deviation for the series of values returned by evaluating the variable's expression. |
static byte |
CALCULATION_SUM
The value is calculated by summing up the values returned by the variable's expression. |
static byte |
CALCULATION_SYSTEM
The value is not calculated by JasperReports. |
static byte |
CALCULATION_VARIANCE
The value is obtained by calculating the variance for the series of values returned by evaluating the variable's expression. |
static java.lang.String |
COLUMN_COUNT
This variable contains the number of records that were processed when generating the current column. |
static java.lang.String |
COLUMN_NUMBER
Built-in variable containing the current column number. |
static java.lang.String |
PAGE_COUNT
Built-in variable containing the number of records that were processed when generating the current page. |
static java.lang.String |
PAGE_NUMBER
Built-in variable containing the current page number. |
static java.lang.String |
REPORT_COUNT
Built-in variable that contains the total number of records read from the datasource. |
static byte |
RESET_TYPE_COLUMN
The variable is reinitialized at the beginning of each new column. |
static byte |
RESET_TYPE_GROUP
The variable is reinitialized every time the group specified by the getResetGroup() method breaks. |
static byte |
RESET_TYPE_NONE
The variable will never be initialized using its initial value expression and will only contain values obtained by evaluating the variable's expression. |
static byte |
RESET_TYPE_PAGE
The variable is reinitialized at the beginning of each new page. |
static byte |
RESET_TYPE_REPORT
The variable is initialized only once, at the beginning of the report filling process, with the value returned by the variable's initial value expression. |
Method Summary | |
---|---|
byte |
getCalculation()
Returns the variable calculation type. |
JRExpression |
getExpression()
Returns the main expression for this variable. |
java.lang.Class |
getIncrementerFactoryClass()
Returns the class of the incrementer factory used for choosing the right incrementer for the variable value. |
java.lang.String |
getIncrementerFactoryClassName()
Returns the string name of the variable value class. |
JRGroup |
getIncrementGroup()
Returns the group whose break triggers the variable increment. |
byte |
getIncrementType()
Returns the variable increment type. |
JRExpression |
getInitialValueExpression()
Returns the initial value expression for this variable. |
java.lang.String |
getName()
Returns the name of the variable. |
JRGroup |
getResetGroup()
Returns the group whose break triggers the variable reset. |
byte |
getResetType()
Returns the variable reset type. |
java.lang.Class |
getValueClass()
Returns the class of the variable value. |
java.lang.String |
getValueClassName()
Returns the string name of the variable value class. |
boolean |
isSystemDefined()
Returns true if the variable calculation type is system defined. |
Methods inherited from interface net.sf.jasperreports.engine.JRCloneable |
---|
clone |
Field Detail |
---|
static final java.lang.String REPORT_COUNT
static final java.lang.String PAGE_COUNT
static final java.lang.String COLUMN_COUNT
static final java.lang.String PAGE_NUMBER
static final java.lang.String COLUMN_NUMBER
static final byte RESET_TYPE_REPORT
static final byte RESET_TYPE_PAGE
static final byte RESET_TYPE_COLUMN
static final byte RESET_TYPE_GROUP
getResetGroup()
method breaks.
static final byte RESET_TYPE_NONE
static final byte CALCULATION_NOTHING
static final byte CALCULATION_COUNT
static final byte CALCULATION_SUM
static final byte CALCULATION_AVERAGE
In order to calculate the average, the engine creates behind the scenes a helper report variable that calculates the sum of the values and uses it to calculate the average for those values. This helper sum variable gets its name from the corresponding average variable suffixed with "_SUM" sequence. This helper variable can be used in other report expressions just like any normal variable.
static final byte CALCULATION_LOWEST
static final byte CALCULATION_HIGHEST
static final byte CALCULATION_STANDARD_DEVIATION
Just like for the variables that calculate the average, the engine creates and uses helper report variables for first obtaining the sum and the count that correspond to your current series of values. The name for those helper variables that are created behind the scenes is obtained by suffixing the user variable with the "_SUM" or "_COUNT" suffix and they can be used in other report expressions like any other report variable.
For variables that calculate the standard deviation, there is always a helper variable present, that first calculates the variance for the series of values and it has the "_VARIANCE" suffix added to its name.
static final byte CALCULATION_VARIANCE
static final byte CALCULATION_SYSTEM
static final byte CALCULATION_FIRST
static final byte CALCULATION_DISTINCT_COUNT
Method Detail |
---|
java.lang.String getName()
java.lang.Class getValueClass()
java.lang.String getValueClassName()
java.lang.Class getIncrementerFactoryClass()
JRIncrementer
,
JRIncrementerFactory
java.lang.String getIncrementerFactoryClassName()
byte getResetType()
byte getIncrementType()
byte getCalculation()
boolean isSystemDefined()
true
if the variable calculation type is system defined.
CALCULATION_SYSTEM
JRExpression getExpression()
JRExpression
instance containing the expression.JRExpression getInitialValueExpression()
JRExpression
instance containing the initial expression.JRGroup getResetGroup()
getResetType()
returns
RESET_TYPE_GROUP
.
JRGroup getIncrementGroup()
getIncrementType()
returns
RESET_TYPE_GROUP
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |