Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: How to set report locale for JasperReports?

  1. #1

    Question How to set report locale for JasperReports?


    So it's possible to set normal parameters in the Action Sequence Design editor for a JasperReport. But if I set REPORT_LOCALE there, it is ignored in the JasperReports output. I'd like to set the language of the report to de_AT. My Browser is set to de_AT, the BI Server's User Interface is in German. So it would be ideal if it worked automatically, but even a manual solution would be OK.

  2. #2


    I hacked up a first solution. If REPORT_LOCALE is set, the component uses that for creating a Locale object and assigns that to the report.

    I'll try to find out how the Pentaho server exposes the current locale and use that for a default value.

    When I have a proper solution, I'll post it.

    Index: /home/bb/download/apcenter/Pentaho/src-svn/1.6GA/pentaho-1.6.GA/server/pentaho/src/org/pentaho/plugin/jasperreports/
          --- /home/bb/download/apcenter/Pentaho/src-svn/1.6GA/pentaho-1.6.GA/server/pentaho/src/org/pentaho/plugin/jasperreports/    (revision 19525)
          +++ /home/bb/download/apcenter/Pentaho/src-svn/1.6GA/pentaho-1.6.GA/server/pentaho/src/org/pentaho/plugin/jasperreports/    (working copy)
          @@ -392,6 +392,12 @@
                 if (debug)
                   debug(Messages.getString("JasperReport.DEBUG_LOADED_DESIGN", Integer.toString(jrparams.length))); //$NON-NLS-1$
          +      //Try to set the report locale
          +      if (isDefinedInput("REPORT_LOCALE")) {
          +          reportParameters.put("REPORT_LOCALE", 
          +                                new java.util.Locale(getInputStringValue("REPORT_LOCALE")));
          +      }
                 // Look for parameters marked as being prompted for
                 // TODO: Handle non-String type parameters
                 boolean needToPrompt = false;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.