views:

548

answers:

2

I have a Jasper report that is successfully being exported to Excel, however all numeric columns (currently of type java.math.BigDecimal) appear in Excel as type "General". This makes it impossible to do numeric operations on the column (such as adding extra 0's) - even if you first convert the format of the cell to be a number. I have tried using different java types for the column but to no avail.

Does anyone know of any way to specify in Jasper that numeric cells should be given a numeric type in Excel?

+1  A: 

It turns out you need to set the following parameter on the JExcelApi Exporter

JExcelApiExporterParameter.IS_DETECT_CELL_TYPE

to be true.

Thanks for updating us with the solution you found. Very helpful.
Jamie Love
A: 

Also big thanks!

Martin