Cell Formatting is different between Xlsx and Xls


Hi Folks,

I've been using JasperReports for a little while now and everything seems to work great, however, today I tried to export my report in the XLSX format and noticed that the formatting of my number cells was not quite right.

I have a few cells that all contain doubles, I have tried using the following to get the cells to format correctly:

-  reportExporter.setParameter(JExcelApiExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE);

-  set the property (net.sf.jasperreports.export.xls.detect.cell.type) to TRUE in the report template;

-  set the cell pattern to #####0.00.

I have tried each of these things individually and all combinations, but no matter what my numeric values (Doubles) are formatted as currency in my XLSX report.  Quite strangely I might add, although formatted as currency, the currency 'unit' is not displayed in the cell, and I get Excel warnings that I have numbers stored as text.  I don't have any of these problems when I change the JRExporter from an XLSX exporter to an XLS exporter.

I have attached a copy of both files to show you what I mean exactly.  They are both attached in XLS format, but I have checked using a copy of Excel 2007 and the cells are definately formatted as currency before conversion.

Can anyone help or advise me on what else I could try?

Thank you,

H Ali

hussainkali's picture
Joined: May 19 2010 - 8:47am
Last seen: 4 years 9 months ago

2 Answers:


The XLSX exporter doesn't currently support net.sf.jasperreports.export.xls.detect.cell.type.

There's no way to workaround the limitation. Log it as a bug/feature request if you want it addressed.



Post Edited by lucianc at 06/15/2010 11:47
lucianc's picture
Joined: Jul 17 2006 - 1:10am
Last seen: 2 days 15 hours ago

it seems to work for 5.6.0 Version

mike2tango's picture
Joined: Sep 4 2013 - 5:56am
Last seen: 1 month 3 weeks ago