This recipe demonstrates how to change the language in a label using parameter.
Major steps include the following:
- 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.
- Add the following parameter into “Report” > “Parameter”:Name = lang
Value = ${lang#choice(en_US,en_UK,fr_FR,de_DE,zh_CN)#en_US} - 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);
To download necessary files for this recipe, refer to the attached ZIP package.
DynamicLabels_Language.zip (10.0 KB)