我有一个 jasper 报告,其中包含输出到 excel,但"java.math.BigDecimal"
值显示为文本。
我已经尝试使用该属性,但仅将"java.lang.Double"
和"java.lang.Integer"
值转换为数字,"java.math.BigDecimal"
字段继续显示为文本。
<property name="net.sf.jasperreports.export.detect.cell.type" value="true"/>
有谁知道有什么方法可以将这种类型的字段"java.math.BigDecimal"
转换为excel中的数字类型单元格? 是否可以进行此转换?
我解决了我的问题在Java中带有一行。我不知道为什么,但我在java中将DetectCellType更改为true,现在可以工作了。
我的代码:
JRXlsExporter xlsExporter = new JRXlsExporter();
SimpleXlsReportConfiguration xlsReportConfiguration = new SimpleXlsReportConfiguration();
xlsReportConfiguration.setDetectCellType(true);
xlsExporter.setConfiguration(xlsReportConfiguration);