net.sf.jasperreports.engine
Interface JRVariable

All Superinterfaces:
java.lang.Cloneable, JRCloneable
All Known Implementing Classes:
JRBaseVariable, JRDesignVariable, JRFillVariable

public interface JRVariable
extends JRCloneable

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).

Version:
$Id: JRVariable.java 5180 2012-03-29 13:23:12Z teodord $
Author:
Teodor Danciu (teodord@users.sourceforge.net)

Field Summary
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.
 
Method Summary
 CalculationEnum getCalculationValue()
          Gets 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.
 IncrementTypeEnum getIncrementTypeValue()
          Gets 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.
 ResetTypeEnum getResetTypeValue()
          Gets 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

REPORT_COUNT

static final java.lang.String REPORT_COUNT
Built-in variable that contains the total number of records read from the datasource. After finishing iterating throught the datasource, it will contain the total number of records that were processed.

See Also:
Constant Field Values

PAGE_COUNT

static final java.lang.String PAGE_COUNT
Built-in variable containing the number of records that were processed when generating the current page.

See Also:
Constant Field Values

COLUMN_COUNT

static final java.lang.String COLUMN_COUNT
This variable contains the number of records that were processed when generating the current column.

See Also:
Constant Field Values

PAGE_NUMBER

static final java.lang.String PAGE_NUMBER
Built-in variable containing the current page number. At the end of the report filling process, it will contain the total number of pages for the resulting document.

See Also:
Constant Field Values

COLUMN_NUMBER

static final java.lang.String COLUMN_NUMBER
Built-in variable containing the current column number.

See Also:
Constant Field Values
Method Detail

getName

java.lang.String getName()
Returns the name of the variable. Since all variables are stored in a map, the variable names are the keys in the map.

Returns:
a string containing the variable name

getValueClass

java.lang.Class<?> getValueClass()
Returns the class of the variable value. Any class is allowed as long as it is in the classpath at compile and run time.

Returns:
a Class instance representing the variable value class

getValueClassName

java.lang.String getValueClassName()
Returns the string name of the variable value class.


getIncrementerFactoryClass

java.lang.Class<?> getIncrementerFactoryClass()
Returns the class of the incrementer factory used for choosing the right incrementer for the variable value.

Returns:
the Class instance of the incrementer factory
See Also:
JRIncrementer, JRIncrementerFactory

getIncrementerFactoryClassName

java.lang.String getIncrementerFactoryClassName()
Returns the string name of the variable value class.


getResetTypeValue

ResetTypeEnum getResetTypeValue()
Gets the variable reset type.

Returns:
a value representing one of the reset type constants in ResetTypeEnum

getIncrementTypeValue

IncrementTypeEnum getIncrementTypeValue()
Gets the variable increment type.

Returns:
a value representing one of the reset type constants in IncrementTypeEnum

getCalculationValue

CalculationEnum getCalculationValue()
Gets the variable calculation type.

Returns:
a value representing one of the calculation type constants in CalculationEnum

isSystemDefined

boolean isSystemDefined()
Returns true if the variable calculation type is system defined.

See Also:
CalculationEnum.SYSTEM

getExpression

JRExpression getExpression()
Returns the main expression for this variable. The expression must be numeric for certain calculation types.

Returns:
a JRExpression instance containing the expression.

getInitialValueExpression

JRExpression getInitialValueExpression()
Returns the initial value expression for this variable. The expression must be numeric for certain calculation types.

Returns:
a JRExpression instance containing the initial expression.

getResetGroup

JRGroup getResetGroup()
Returns the group whose break triggers the variable reset. Only used when getResetTypeValue() returns ResetTypeEnum.GROUP.


getIncrementGroup

JRGroup getIncrementGroup()
Returns the group whose break triggers the variable increment. Only used when getIncrementTypeValue() returns ResetTypeEnum.GROUP.



© 2001-2010 Jaspersoft Corporation www.jaspersoft.com