tural.muradbeyli Posted May 23, 2013 Share Posted May 23, 2013 I've created report using iReport 4.5.1 which contains tables with fields of amount values. Value of "Pattern" property of these fields is "$ #,##0.00". When I run report from iReport I see right formatted amount, but when I run report from Java code (library version is 5.0.0), I see same amounts but without formatting. Why formatting disappears when I run report from Java code? How to fix it? Link to comment Share on other sites More sharing options...
Solution Ankur Gupta Posted June 5, 2013 Solution Share Posted June 5, 2013 Hi tural,The formatting done in the iReport is report specific it like extra utility , of providing the pattern provided by the iReport. When you run that in java code the formatting is removed. So what you can do for the java code is that you could use: new java.text.DecimalFormat("pattern").format(put the field here) So to provide similarity in the report and in the Java code what can be done is that you could replace the expression of the text field with the same expression and the discrepancy could be easily taken care off.In that case the expression would look something like this new java.text.DecimalFormat("¤ #,##0").format($F{VALUE}) Now here the in the field expression easily , any field or parameter could be put and same would work fine for java code too, Hope that it solves your query Thanks,Ankur 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