Community
Participate
Working Groups
Hi, I have a problem with amounts format using "gl" locale. Birt generates 1,234.46 € instead of 1.234,46 that will be ok. If I change the default locale of JVM to "es" that has the same format for dates and amounts that "gl", it neither runs ok. Could I change the default locale of Birt with which it had to format the dates and amounts should not find the specified locale ? Thanks in advance.
I don't quite understand the issue. You can change the default locale in preference of report design or on the specific dataitem. You can change the number format to hide the currency symbol.
Sorry if I explained poorly. I mean to change the default locale using by the ReportEngine, in case that locale specified in the design ("gl") does not exist for the formatting of numbers for example. "gl" is not a locale included in the java jre, but I have an external library that allows me to incorporate it, including the library in JAVA_HOME/lib/ext. If I run a Java application with the locale "gl" works ok, but BIRT does not, it always format the numbers using the english locale (I suspect it is because the OS is in English but with the locale in Spanish). I hope I explained better. Thanks again.
Pico, How do you set locale "gl" for a java application? Can you show us the code? If "gl" is a custom locale, is it possible for us to reproduce this problem by a standard java locale?
Hi, public static void main(String [ ] args) { final Locale glLocale = new Locale("gl"); // language = Galician, country = Spain final String myDateStr = DateFormat.getDateInstance(DateFormat.FULL, glLocale).format(new Date()); System.out.println(myDateStr); } This runs ok, but the birt reports don´t format well the date, using the same JVM. Thanks, a lot. (In reply to comment #3) > Pico, > > How do you set locale "gl" for a java application? Can you show us the code? > If "gl" is a custom locale, is it possible for us to reproduce this problem by > a standard java locale?
Hi, I install the extesion of http://www.javagalician.org/ in my JVM and the before code runs ok, but in Birt with "gl" locale, dates and numbers had bad format. Thanks. (In reply to comment #4) > Hi, > > public static void main(String [ ] args) > { > > final Locale glLocale = new Locale("gl"); // language = > Galician, country = Spain > final String myDateStr = DateFormat.getDateInstance(DateFormat.FULL, > glLocale).format(new Date()); > System.out.println(myDateStr); > > } > > This runs ok, but the birt reports don´t format well the date, using the same > JVM. > > Thanks, a lot. > > > (In reply to comment #3) > > Pico, > > > > How do you set locale "gl" for a java application? Can you show us the code? > > If "gl" is a custom locale, is it possible for us to reproduce this problem by > > a standard java locale?
Hi, I do this before run, and not works, with "gl", but it runs ok with "es" and "ca". runAndRenderTask.setLocale(new Locale("gl")); Thanks.
I did new discoveries...with JDK 1.5.0_13 it runs ok(out of my numbers in report: 1.234,56), with JRE not, and with JDK 1.6 neither(out: 1,234.56). It is very strange, Could someone help me, please? Thank in advance.
After you install the package, do you use the tool in the package to verify if the locale is supported? I am testing the 1.1 in JDK 1.6.20 (64bit), the verification fails: --------------------------------------------------- GALICIAN LOCALE gl AVAILABLE BUT NOT CORRECT!! --------------------------------------------------- --------------------------------------------------- GALICIAN LOCALE gl_ES AVAILABLE BUT NOT CORRECT!! --------------------------------------------------- Please note that the 1.1 doesn't support JDK1.5 or before.
BIRT need to be enhanced in constructing the DecimalFormatSymbols for different locales. Instead of using new DecimalFormatSymbols(Locale), BIRT should use DecimalFormatSymbols.getInstance(Locale) to get the symbols used in a locale, so the user defined symbols (through the SymbolProvider) can be used, see http://download-llnw.oracle.com/javase/6/docs/api/java/text/DecimalFormatSymbols.html#getInstance%28java.util.Locale%29 Please note that this API is only provided in JDK1.6, we need check the BIRT specification to see if we can make the change in BIRT 2.6.x. For a workaround, I think you can define the format pattern explicit for as 'C', see the attached report design.
Created attachment 176952 [details] A sample for currency format in gl locale.
Thanks Wei Yang, At first verification after installing the package javagalician was OK. Are there possibilities the change that you say is for 2.6.1 official release, coul i get any patch? The report design that you attach was builtwith version 2.6.1 and I have the 2.6.0. I attacha report design built with 2.6.0 with a data item, an item parameter and a Text item. I need the report to work with three locales that I change in run time ("es", "ca" and "gl") with : runAndRenderTask.setLocale (new Locale ("gl")); If I choose locale "gl" for the Data Item and Parameter do not format ok"gl","ca","es." If I select Auto in locale "es" and "ca" well formatted. Any idea? Another question, do not use BIRT com.ibm.icu for internationalization? in this library already includes the locale "gl." Anyway I do not understand what I say in the commentary 7, why the jdk 1.5.0_13 work properly? Again thank you very much. Greetings.
Created attachment 176970 [details] A sample with 2.6.0
Anyway I do not understand what I say in the commentary 7, why the jdk 1.5.0_13 work properly without javagalician package installed? (In reply to comment #11) > Thanks Wei Yang, > > At first verification after installing the package javagalician was OK. > > Are there possibilities the change that you say is for 2.6.1 official release, > coul i get any patch? > > The report design that you attach was builtwith version 2.6.1 and I have the > 2.6.0. > I attacha report design built with 2.6.0 with a data item, an item parameter > and a Text item. I need the report to work with three locales that I change in > run time ("es", "ca" and "gl") with : > > runAndRenderTask.setLocale (new Locale ("gl")); > > If I choose locale "gl" for the Data Item and Parameter do not format > ok"gl","ca","es." If I select Auto in locale "es" and "ca" well formatted. Any > idea? > > Another question, do not use BIRT com.ibm.icu for internationalization? in this > library already includes the locale "gl." > > Anyway I do not understand what I say in the commentary 7, why the jdk 1.5.0_13 > work properly? > > Again thank you very much. > > Greetings.
schedule to 4.0.0 to use the API in JDK 1.6, see comment 9.