Jasper Reports can't use resourceBundle for internationalization in Products Posted December 14, 2018 Hi,I want to apply internationalization in my jasper report. Can anyone tell me what am i doing wrong? I have two resource bundles:balance_de.propertiesbalance_en.propertiesMy resource bundle looks like this: mainTitle = title secondaryTitle = secondary titleResource bundles are in the same folder as the class that is using them.I am loading resource bundle:HashMap<String, Object> parameters = new HashMap<>();ResourceBundle resourceBundle = ResourceBundle.getBundle("balance", new Locale("de", "DE"));parameters.put("REPORT_RESOURCE_BUNDLE", resourceBundle);In jrxml report i am trying to obtain the mainTitle value from resource bundle: <textField> <reportElement x="0" y="0" width="798" height="20" uuid="0b25b17c-b0f4-4d46-975d-ffea5c518f28"/> <box> <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"/> <textFieldExpression class="java.lang.String"> <![CDATA[$R{mainTitle}]]> </textFieldExpression> </textField>However it is not working, and i have no idea why.
Jasper Reports can't use resourceBundle for internationalization
in Products
Posted
Hi,
I want to apply internationalization in my jasper report. Can anyone tell me what am i doing wrong?
I have two resource bundles:
My resource bundle looks like this:
Resource bundles are in the same folder as the class that is using them.
I am loading resource bundle:
In jrxml report i am trying to obtain the mainTitle value from resource bundle:
However it is not working, and i have no idea why.