Hi there,
I am working on ireport 5.0.1. I have tried the currency format for my report but somehow it is not giving me the result.
This is my code for the Textfield
<textField pattern="###0.00" isBlankWhenNull="true">
<reportElement uuid="133b0863-16ee-425e-b230-4fff9ef5ffc6" x="432" y="1" width="112" height="14"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$V{netAmt}+" "]]></textFieldExpression>
</textField>
Can somebody help me through it?
3 Answers:
Posted on March 25, 2014 at 10:07am
The pattern for currency is ¤ #,##0.00 EXAMPLE <textField pattern="¤ #,##0.00">
When exporting to excel I get a weird pattern so I change it to this - $ #,##0.00 EXAMPLE <textField pattern="$ #,##0.00">
Why are you adding " " to the variable?
Posted on March 25, 2014 at 10:32pm
>$V{netAmt}+" "
You're converting number to a String. That means it won't use pattern for a number. JasperReports check on datatype when formating values. You're not getting what you want because of this.
You'll have to tell us what you're expecting and what you're getting. Seems like the format is set to number rather without any currency mark.