[#6566] - JRXlsExporter doesn't support RTL

Category:
Bug report
Priority:
Urgent
Status:
New
Project: Severity:
Critical
Resolution:
Open
Component: Reproducibility:
N/A
Assigned to:

The below code does not make the out put sheet set to RTL

exporter = new JRXlsxExporter();
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(out));
SimpleXlsxExporterConfiguration configuration = new SimpleXlsxExporterConfiguration();
exporter.setConfiguration(configuration);

The code works if we use the JRXlsExporter, as below:

exporter = new JRXlsExporter();
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(out));
SimpleXlsReportConfiguration configuration2 = new SimpleXlsReportConfiguration();
configuration2.setSheetDirection(RunDirectionEnum.RTL);
exporter.setConfiguration(configuration2);

v6.2
afattahi's picture
Joined: Dec 5 2015 - 8:12am
Last seen: 1 year 4 months ago

1 Comment:

#1
  • Priority:Normal» Urgent
  • Severity:Tweak» Critical
  • Reproducibility:Always» N/A

Dear Team,

We want to generated .xlsx file sheet direction from RTL for Arabic export data but below code doesn't support sheet direction RTL.

We are using apache poi dependencies 3.15 and jasper 6.18.1.

Below stackoverflow link just to use new File (Seems to be a bug in the jasper report library tested with v 6.1.1, adding code below after export it will work correctly (with poi libraries included in jasper report distribution, so no bug in POI...).)

But we don't want to save file in project directory. we are using HttpServletResponse to download the file.
https://stackoverflow.com/questions/34116925/jasper-report-how-to-create...

Kindly help ..

Below code not working to RTL sheet direction:
===============================================
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();

SimpleXlsxReportConfiguration reportConfiguration = new SimpleXlsxReportConfiguration();

reportConfiguration.setFontSizeFixEnabled(true);
reportConfiguration.setDetectCellType(true);
reportConfiguration.setOnePagePerSheet(true);

JRXlsxExporter exporter = new JRXlsxExporter();
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(byteArrayOutputStream));
if (lang == true) {
reportConfiguration.setSheetDirection(RunDirectionEnum.RTL);
reportConfiguration.setSheetNames(new String[] {"Teams and Groups"});
} else {
reportConfiguration.setSheetDirection(RunDirectionEnum.LTR);
reportConfiguration.setSheetNames(new String[] { "Teams and Groups" });
}
exporter.setConfiguration(reportConfiguration);
exporter.exportReport();
byte[] response = byteArrayOutputStream.toByteArray();
byteArrayOutputStream.flush();
byteArrayOutputStream.close();

Feedback
randomness