abhinashdora Posted March 25, 2014 Share Posted March 25, 2014 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? Link to comment Share on other sites More sharing options...
hozawa Posted March 25, 2014 Share Posted March 25, 2014 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. Link to comment Share on other sites More sharing options...
joehodges2012 Posted March 25, 2014 Share Posted March 25, 2014 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? Link to comment Share on other sites More sharing options...
hozawa Posted March 26, 2014 Share Posted March 26, 2014 >$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. Link to comment Share on other sites More sharing options...
abhinashdora Posted March 26, 2014 Author Share Posted March 26, 2014 Thank you joehodges for the help. I remove the " " added to the variable and it's works fine. Link to comment Share on other sites More sharing options...
abhinashdora Posted March 26, 2014 Author Share Posted March 26, 2014 Thank you hozawa for the help. You are right about the " " added to the variable. Link to comment Share on other sites More sharing options...
uma.janakaraj Posted September 1, 2014 Share Posted September 1, 2014 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now