Currency format not working

0

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?
abhinashdora's picture
Joined: Apr 30 2012 - 12:28pm
Last seen: 5 years 5 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 - 5 years 5 months ago

3 Answers:

-1

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: 5 months 5 days ago

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

abhinashdora - 5 years 5 months ago
0

>$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
47047
Joined: Apr 24 2010 - 4:31pm
Last seen: 2 months 2 weeks ago

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

abhinashdora - 5 years 5 months ago
0

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: 4 years 11 months ago
Feedback
randomness