0
I have the following problem:
I developed a report in iReport 5.5.1
where I added the data of a column into a variable because I need to show this total, and then I need to take these totals and sum it all into a new variable in order to show the total macro, exemplifying:
There are several types of fault and each with its total, for example,
"Joãozinho had 20 fouls for pain in the foot and 10 fouls for laziness"
My first variable, would return the numbers 20 and 10, now the second would add up these results and show. But when I try to do this in a conventional way, that would be creating a variable and the value expression
assign the other, iReport simply goes crazy and makes some sums without foot or head.
Follows the code:
<variable name="TOTDIAS_LICENCA" class="java.math.BigDecimal" resetType="Group" resetGroup="LICENCA_PRORROGA" calculation="Sum">
<variableExpression><![CDATA[$F{TOTDIAS}]]></variableExpression>
</variable>
<variable name="variable1" class="java.lang.String" resetType="Group" resetGroup="LICENCA_PRORROGA" calculation="Sum"/>
<variable name="DIAS_PRORROG" class="java.math.BigDecimal" resetType="Group" resetGroup="LICENCA_PRORROGA">
<variableExpression><![CDATA[$V{TOTDIAS_LICENCA}.compareTo( $F{DIAS_MINIMO})>0 ?$V{TOTDIAS_LICENCA}.subtract($F{DIAS_MINIMO}) : new BigDecimal(0)]]></variableExpression>
<initialValueExpression><![CDATA[0]]></initialValueExpression>
</variable>
<variable name="TOTFINAL" class="java.lang.Integer" resetType="Group" resetGroup="AQUISITIVO" calculation="Sum">
<variableExpression><![CDATA[$V{DIAS_PRORROG}]]></variableExpression>
<initialValueExpression><![CDATA[0]]></initialValueExpression>
</variable>