Menu

#7 Problem Chart timeline with REPORT_LOCALE

v1.0_(example)
open
nobody
None
3
2013-09-30
2013-09-30
Julian
No

Hi,
I'm using DynamicJasper 4.0.3 and JasperReport 5.2.0. I use Java 7.
I use DynamicJasper to make a dynamics table and chart (timeline) in a PDF report. All my table and chart are coded in JAVA.

The problem is that my chart doesn't take the REPORT_LOCALE to change the language of the months on the X axis. It seems to take always the JVM LOCALE. But I want the chart takes the current locale of my site.

Here is how I create my report:

HashMap parameters = new HashMap();
parameters.put("REPORT_LOCALE", locale);//Locale.ENGLISH or Locale.FRENCH

DynamicReport dr = buildReport();
JRDataSource ds = new JRBeanCollectionDataSource(data);
JasperReport report = DynamicJasperHelper.generateJasperReport(dr, new ClassicLayoutManager(), parameters);
JasperPrint jasperPrint = JasperFillManager.fillReport(report, parameters, ds);

byte[] output = JasperExportManager.exportReportToPdf(jasperPrint);

The chart is built with a DJTimeSeriesChartBuilder:

DJTimeSeriesChartBuilder djChart = new DJTimeSeriesChartBuilder();

DJAxisFormat timeAxisFormat = new DJAxisFormat("Months");
timeAxisFormat.setTickLabelMask("MM");
...
djChart.setTimeAxisFormat(timeAxisFormat);
...

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.