sgarciaf Posted June 1, 2010 Share Posted June 1, 2010 Hi,I'm doing a report with some lists of numbers and they are showing with the format: 1,000.00 & I want to show the numbers like 1.000,00I tried to use as custom format in the pattern this:##.#00,00but it doesnt work, the report is not compiling after doing only this change. Anyone can help me? Link to comment Share on other sites More sharing options...
slow Posted June 3, 2010 Share Posted June 3, 2010 uhm...the char:, represents a grouping separator. represents a decimal separator...so you can't exchange their position...you must set a pattern like "##,#00.00" an the change the LOCALE according to the format you expect:change the LOCALE from - build-->setReportLocale-->choose one (from ireport 2 and similar)- Tool-->Option-->Compilation and Execution-->Execution Option -->Select Report Locale (for ireprt 3.7 and siimilar) (i prefer OLD VERSION of IReport...! ) _________________________________________if it works... give me KARMA points please! : ) _________________________________________listening: MUSICA NUDA - Sacrifice Link to comment Share on other sites More sharing options...
sgarciaf Posted June 3, 2010 Author Share Posted June 3, 2010 Thanks Slow. This solves the problem if I compile with iReports, but I'm compiling the report with a java application in a server...I have the same problem with dates and the numbers in the charts...I tried to put in the expression something like:NumberFormat.getNumberInstance(Locale.GERMAN).format($V{numAyuMeasure})But this only solves the numbers format and not the numbers in the chart and dates. There's a way to set the Report Locale options in Java? Well, at least I know what's the problem now... Link to comment Share on other sites More sharing options...
slow Posted June 3, 2010 Share Posted June 3, 2010 sorry, I thought the problem was the interface of iReport...try putting this in the data map you pass when you compile and run the report:Locale locale = new Locale("en", "US") <--- change this.metadata.put(JRParameter.REPORT_LOCALE, locale); remember KARMA points :) _________________________________________if it works... give me KARMA points please! : ) _________________________________________listening: Placebo - Where is my mind Link to comment Share on other sites More sharing options...
sgarciaf Posted June 3, 2010 Author Share Posted June 3, 2010 Thanks slow, I set the parameter:parameters.put("REPORT_LOCALE", new java.util.Locale("es", "ES")); //SPANISH & now the numbers in the lists and in the crosstabs are showing ok, but the numbers in the charts (in the axis) are stil showing like 1,000.00). I passed the REPORT_LOCALE to all my subreports (its a paremeter) and the same for all my queries (& in the charts I set the parameter), but it didnt work in charts. Thanks. Link to comment Share on other sites More sharing options...
slow Posted June 3, 2010 Share Posted June 3, 2010 unfortunately I don't use charts created using iReport so I can't help you in this... but i think there is a way to pass the locale you set to JFreeChart (engine that create the chart)...read this:http://stackoverflow.com/questions/1588196/passing-locale-details-via-jasper-reports-to-jfreechartor similar.if you find a solution, post it :) Link to comment Share on other sites More sharing options...
sgarciaf Posted June 3, 2010 Author Share Posted June 3, 2010 It worked ^^ I copy-pasted the code in your link and worked :D Thanks & karma++; Link to comment Share on other sites More sharing options...
slow Posted June 3, 2010 Share Posted June 3, 2010 thank you for the reply... help someone,even if unknown, has a special charm... listening: Nine Inch Nails - HURT. Link to comment Share on other sites More sharing options...
smilingpanda Posted February 2, 2016 Share Posted February 2, 2016 In desperate need for help. I prepared a report via ireport and changed the number format, it works perfectly when it's an english locale but it does nothing when i change the local to french!! How can I fix this?? 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