如何将 jasper 报告导出到 excel 格式字段
How to export jasper report to excel formatting fields
我有一个输出到excel的jasper报告,但是"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);
我有一个输出到excel的jasper报告,但是"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);