public interface JRSubreportReturnValue extends VariableReturnValue
subreportVariable
attribute (see getSubreportVariable()
) specifies the name
of the subreport variable whose value is to be returned. At fill time, the name is checked to
ensure it is an existing variable name of the report specified by the subreport expression.
The toVariable
attribute (see CommonReturnValue.getToVariable()
) specifies the name of
the parent report variable whose value is
to be copied/incremented with the value from the subreport. The name is checked at
compile time to ensure it is an existing variable name of the master report. At fill time,
the system checks that the types of the subreport and master variables are compatible.
A value returned from a subreport can simply be copied into the target master report
variable, or it can be subject to a certain type of calculation made on the variable. The
type of the operation performed with the returned value is specified by the calculation
attribute (see getCalculationValue()
), which works like the homonym attribute
of the <variable>
element. The default value is Nothing
,
which means that the value returned from the subreport will be simply copied into the
master report variable.
Just as for report variables, the engine lets users customize how they want the returned
subreport values handled. The incrementerFactoryClass
attribute
(see CommonReturnValue.getIncrementerFactoryClassName()
) specifies the
factory class for creating the incrementer instance. The attribute is equivalent to the same
attribute of the <variable>
element.
A variable of the master report used when returning values from subreports should be
declared with System
calculation because its value is not calculated by the main
calculation engine. The variable could declare a reset type, for example, when the sum of
a subreport total is to be calculated per one of the master's groups. The same value can
be returned more than once from a subreport, for example, if different calculations are
required.
Note that the value from the subreport is not returned on a column or page break, but
only when the subreport filling is done. Also note that the calculation is a two-level
process - that is, if the subreport computes a total average and the master accumulates
values from the subreports using calculated averages, then the master result will be the
average of the subreport averages, not the average of the combined subreport records.Modifier and Type | Method and Description |
---|---|
CalculationEnum |
getCalculationValue()
Deprecated.
Replaced by
CommonReturnValue.getCalculation() . |
String |
getSubreportVariable()
Deprecated.
Replaced by
VariableReturnValue.getFromVariable() . |
getFromVariable
getCalculation, getIncrementerFactoryClassName, getToVariable
clone
String getSubreportVariable()
VariableReturnValue.getFromVariable()
.CalculationEnum getCalculationValue()
CommonReturnValue.getCalculation()
.When copying the value from the subreport, a formula can be applied such that sum, maximum, average and so on can be computed.
Copyright © 2016. All rights reserved.