JasperApi exports numbers as text

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

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

+4
source share
1 answer

Turns out you need to set the following parameter to Exporter JExcelApi

JExcelApiExporterParameter.IS_DETECT_CELL_TYPE 

to be true.

+6
source

All Articles