Jump to content

radoslaw.kaniecki

Members
  • Posts

    1
  • Joined

  • Last visited

 Content Type 

Forum

Downloads

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Events

Profiles

Posts posted by radoslaw.kaniecki

  1. 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.properties
    • balance_en.properties

    My resource bundle looks like this:

    •     mainTitle = title
    •     secondaryTitle = secondary title

    Resource 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.

     

×
×
  • Create New...