Currency format not working


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>
Can somebody help me through it?
abhinashdora's picture
Joined: Apr 30 2012 - 12:28pm
Last seen: 7 years 2 months ago

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.

hozawa - 7 years 2 months ago

3 Answers:


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? 

joehodges2012's picture
Joined: Aug 27 2013 - 6:38am
Last seen: 2 years 2 months ago

Thank you joehodges for the help. I remove the " " added to the variable and it's works fine.

abhinashdora - 7 years 2 months ago

>$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.

hozawa's picture
Joined: Apr 24 2010 - 4:31pm
Last seen: 2 years 6 days ago

Thank you hozawa for the help. You are right about the " " added to the variable.

abhinashdora - 7 years 2 months ago

my report is displaying now 24.552.345 need to replace the last dot with comma like 24.552,345 but i tried with so many  options, its throwing error. pls help if anybody knows the solution.

uma.janakaraj's picture
Joined: Aug 26 2014 - 8:21pm
Last seen: 6 years 8 months ago