Jump to content
We've recently updated our Privacy Statement, available here ×

lappera

Members
  • Posts

    1
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by lappera

  1. Hey, I'm trying to create a report with multiple subreports contained within it that is localised. I've passed the REPORT_RESOURCE_BUNDLE and the REPORT_LOCALE to JasperFillManager using the hash map of parameters. The translations are working on the master report, however all sub reports are still in english, despite passing the master reports parameters to them via the parameterMapExpression. I have also confirmed the correct parameters (resource bundle and locale) have been passed to the sub report by printing them onto the sub report. The properties files are named in the convention: messages_es.properties, messages_fr.properties etc.. I'm creating the hashmap as follows: final ResourceBundle resourceBundle = ResourceBundle.getBundle("org.example.messages", new Utf8Control());parameters.put(JRParameter.REPORT_RESOURCE_BUNDLE, resourceBundle);parameters.put(JRParameter.REPORT_LOCALE, printParameters.getLocale());final JasperPrint jasperPrint = JasperFillManager.fillReport(layoutJasperReport, parameters, jasperDataSource);[/code]Then in the master report, I'm passing the parameters to the sub report like this: <subreport>... <parametersMapExpression><![CDATA[$P{REPORT_PARAMETERS_MAP}]]></parametersMapExpression>...</subreport>[/code]Finally, in the sub report i'm trying to get a localised property by using: <textField>... <textFieldExpression><![CDATA[$R{key}]]></textFieldExpression>...</textField>[/code]Could anyone offer some insight into why this could be happening?
×
×
  • Create New...