How To Work On Dynamic Labels (Language)

This recipe demonstrates how to change the language in a label using parameter.

Major steps include the following:

  1. Create a report template using the given datasource (Customer Listing.ds and Locales.ds). This report template makes use of secondary datasource to display the respective labels.
  2. Add the following parameter into “Report” > “Parameter”:Name = lang
    Value = ${lang#choice(en_US,en_UK,fr_FR,de_DE,zh_CN)#en_US}
  3. Insert the following Java code into “Section Header” > “On Render Begin”:props = new java.util.Properties();
    props.setProperty(“lang”,Properties.getProperty(“lang”));
    LocaleDS=DataCacheManager.loadCache(“Locales”,props);

DynamicLabels-Language

To download necessary files for this recipe, refer to the attached ZIP package.
DynamicLabels_Language.zip (10.0 KB)