Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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 3583 2010-03-12 11:35:40Z shertage $
Author:
  Teodor Danciu (teodord@users.sourceforge.net)

Field Summary
`static byte` | `CALCULATION_AVERAGE` Deprecated. Replaced by `CalculationEnum.AVERAGE`.
`static byte` | `CALCULATION_COUNT` Deprecated. Replaced by `CalculationEnum.COUNT`.
`static byte` | `CALCULATION_DISTINCT_COUNT` Deprecated. Replaced by `CalculationEnum.DISTINCT_COUNT`.
`static byte` | `CALCULATION_FIRST` Deprecated. Replaced by `CalculationEnum.FIRST`.
`static byte` | `CALCULATION_HIGHEST` Deprecated. Replaced by `CalculationEnum.HIGHEST`.
`static byte` | `CALCULATION_LOWEST` Deprecated. Replaced by `CalculationEnum.LOWEST`.
`static byte` | `CALCULATION_NOTHING` Deprecated. Replaced by `CalculationEnum.NOTHING`.
`static byte` | `CALCULATION_STANDARD_DEVIATION` Deprecated. Replaced by `CalculationEnum.STANDARD_DEVIATION`.
`static byte` | `CALCULATION_SUM` Deprecated. Replaced by `CalculationEnum.SUM`.
`static byte` | `CALCULATION_SYSTEM` Deprecated. Replaced by `CalculationEnum.SYSTEM`.
`static byte` | `CALCULATION_VARIANCE` Deprecated. Replaced by `CalculationEnum.VARIANCE`.
`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` Deprecated. Replaced by `ResetTypeEnum.COLUMN`.
`static byte` | `RESET_TYPE_GROUP` Deprecated. Replaced by `ResetTypeEnum.GROUP`.
`static byte` | `RESET_TYPE_NONE` Deprecated. Replaced by `ResetTypeEnum.NONE`.
`static byte` | `RESET_TYPE_PAGE` Deprecated. Replaced by `ResetTypeEnum.PAGE`.
`static byte` | `RESET_TYPE_REPORT` Deprecated. Replaced by `ResetTypeEnum.REPORT`.

Method Summary
`byte` | `getCalculation()` Deprecated. Replaced by `getCalculationValue()`.
`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.
`byte` | `getIncrementType()` Deprecated. Replaced by `getIncrementTypeValue()`.
`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.
`byte` | `getResetType()` Deprecated. Replaced by `getResetTypeValue()`.
`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

### RESET_TYPE_REPORT

    static final byte RESET_TYPE_REPORT

  Deprecated. Replaced by `ResetTypeEnum.REPORT`.
  See Also:
    Constant Field Values

### RESET_TYPE_PAGE

    static final byte RESET_TYPE_PAGE

  Deprecated. Replaced by `ResetTypeEnum.PAGE`.
  See Also:
    Constant Field Values

### RESET_TYPE_COLUMN

    static final byte RESET_TYPE_COLUMN

  Deprecated. Replaced by `ResetTypeEnum.COLUMN`.
  See Also:
    Constant Field Values

### RESET_TYPE_GROUP

    static final byte RESET_TYPE_GROUP

  Deprecated. Replaced by `ResetTypeEnum.GROUP`.
  See Also:
    Constant Field Values

### RESET_TYPE_NONE

    static final byte RESET_TYPE_NONE

  Deprecated. Replaced by `ResetTypeEnum.NONE`.
  See Also:
    Constant Field Values

### CALCULATION_NOTHING

    static final byte CALCULATION_NOTHING

  Deprecated. Replaced by `CalculationEnum.NOTHING`.
  See Also:
    Constant Field Values

### CALCULATION_COUNT

    static final byte CALCULATION_COUNT

  Deprecated. Replaced by `CalculationEnum.COUNT`.
  See Also:
    Constant Field Values

### CALCULATION_SUM

    static final byte CALCULATION_SUM

  Deprecated. Replaced by `CalculationEnum.SUM`.
  See Also:
    Constant Field Values

### CALCULATION_AVERAGE

    static final byte CALCULATION_AVERAGE

  Deprecated. Replaced by `CalculationEnum.AVERAGE`.
  See Also:
    Constant Field Values

### CALCULATION_LOWEST

    static final byte CALCULATION_LOWEST

  Deprecated. Replaced by `CalculationEnum.LOWEST`.
  See Also:
    Constant Field Values

### CALCULATION_HIGHEST

    static final byte CALCULATION_HIGHEST

  Deprecated. Replaced by `CalculationEnum.HIGHEST`.
  See Also:
    Constant Field Values

### CALCULATION_STANDARD_DEVIATION

    static final byte CALCULATION_STANDARD_DEVIATION

  Deprecated. Replaced by `CalculationEnum.STANDARD_DEVIATION`.
  See Also:
    Constant Field Values

### CALCULATION_VARIANCE

    static final byte CALCULATION_VARIANCE

  Deprecated. Replaced by `CalculationEnum.VARIANCE`.
  See Also:
    Constant Field Values

### CALCULATION_SYSTEM

    static final byte CALCULATION_SYSTEM

  Deprecated. Replaced by `CalculationEnum.SYSTEM`.
  See Also:
    Constant Field Values

### CALCULATION_FIRST

    static final byte CALCULATION_FIRST

  Deprecated. Replaced by `CalculationEnum.FIRST`.
  See Also:
    Constant Field Values

### CALCULATION_DISTINCT_COUNT

    static final byte CALCULATION_DISTINCT_COUNT

  Deprecated. Replaced by `CalculationEnum.DISTINCT_COUNT`.
  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.

### getResetType

    byte getResetType()

  Deprecated. Replaced by `getResetTypeValue()`.

### getIncrementType

    byte getIncrementType()

  Deprecated. Replaced by `getIncrementTypeValue()`.

### 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`

### getCalculation

    byte getCalculation()

  Deprecated. Replaced by `getCalculationValue()`.

### 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:
    `CALCULATION_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 `getResetType()` returns `RESET_TYPE_GROUP`.

### getIncrementGroup

    JRGroup getIncrementGroup()

  Returns the group whose break triggers the variable increment. Only used when `getIncrementType()` returns `RESET_TYPE_GROUP`.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com