links for 2011-05-31

1 06 2011
  • package org.kodejava.example.util;

    import java.util.Currency;
    import java.util.Locale;

    public class CurrencySymbol {
    public static void main(String[] args) {
    Currency currency = Currency.getInstance(Locale.JAPAN);
    System.out.println("Currency.getSymbol() = " + currency.getSymbol());

    currency = Currency.getInstance(Locale.UK);
    System.out.println("Currency.getSymbol() = " + currency.getSymbol());

    currency = Currency.getInstance(Locale.US);
    System.out.println("Currency.getSymbol() = " + currency.getSymbol());

    currency = Currency.getInstance(new Locale("in", "ID"));
    System.out.println("Currency.getSymbol() = " + currency.getSymbol());
    }
    }

  • The locale is set during execution and is not stored in the JRXML file.

    If you run the report through iReport, it is possible to set the report locale in the Options window under the "Report execution options" section in the General tab. This will change how iReport runs your report.

    If you run the report embedded in Java, you set the REPORT_LOCALE parameter, like you mention. The following code is what I use:

    Locale locale = new Locale("en", "US");
    metadata.put(JRParameter.REPORT_LOCALE, locale);

    Where metadata is the parameter map sent to fillReport(…).


Acciones

Information

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s




A %d blogueros les gusta esto: