I have a variable V{Total} where the pattern ###0.00 is not applied, what am I missing?
<textField pattern="###0.00" isBlankWhenNull="false">
<reportElement uuid="ea9933c9-1863-474f-a6e2-65cfe3f07426" x="390" y="9" width="144" height="20" forecolor="#000000"/>
<box>
<pen lineColor="#999999"/>
<topPen lineColor="#999999"/>
<leftPen lineColor="#999999"/>
<bottomPen lineWidth="0.5" lineColor="#999999"/>
<rightPen lineColor="#999999"/>
</box>
<textElement>
<font fontName="Verdana" isBold="true" isUnderline="false"/>
</textElement>
<textFieldExpression><![CDATA[$V{Total}+".- €"]]</textFieldExpression>
</textField>
You are trying to format a string:
$V{Total}+".- €"will be a string, even if the the variable was decimal adding the.-€will turn it into a string, thus meaning your formatting won’t workWhat you need to do is format the value on its own and the add the trailing characters, try something like this:
Full Solution: