From 355ad052d6499f5c562a1d22105f3cf8ed291a35 Mon Sep 17 00:00:00 2001 From: plq1210 <717208317@qq.com> Date: Mon, 13 Nov 2017 11:45:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A8=A1=E6=9D=BF=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E6=A0=B7=E5=BC=8F=E4=B8=8E=E6=A8=A1=E6=9D=BF=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../excel/export/template/ExcelExportOfTemplateUtil.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/easypoi-base/src/main/java/cn/afterturn/easypoi/excel/export/template/ExcelExportOfTemplateUtil.java b/easypoi-base/src/main/java/cn/afterturn/easypoi/excel/export/template/ExcelExportOfTemplateUtil.java index 986ae2e..3fd56d1 100644 --- a/easypoi-base/src/main/java/cn/afterturn/easypoi/excel/export/template/ExcelExportOfTemplateUtil.java +++ b/easypoi-base/src/main/java/cn/afterturn/easypoi/excel/export/template/ExcelExportOfTemplateUtil.java @@ -53,6 +53,7 @@ import cn.afterturn.easypoi.excel.export.template.TemplateSumHanlder.TemplateSum import cn.afterturn.easypoi.excel.html.helper.MergedRegionHelper; import cn.afterturn.easypoi.exception.excel.ExcelExportException; import cn.afterturn.easypoi.exception.excel.enums.ExcelExportEnum; +import cn.afterturn.easypoi.util.PoiCellUtil; import cn.afterturn.easypoi.util.PoiExcelGraphDataUtil; import cn.afterturn.easypoi.util.PoiPublicUtil; import cn.afterturn.easypoi.util.PoiSheetUtility; @@ -301,8 +302,7 @@ public final class ExcelExportOfTemplateUtil extends BaseExportService { cell = row.getCell(i); if (row.getCell(i) != null && (cell.getCellType() == Cell.CELL_TYPE_STRING || cell.getCellType() == Cell.CELL_TYPE_NUMERIC)) { - cell.setCellType(Cell.CELL_TYPE_STRING); - String text = cell.getStringCellValue(); + String text = PoiCellUtil.getCellValue(cell); // plq modify at 2017-11-11 if (text.contains(FOREACH_COL) || text.contains(FOREACH_COL_VALUE)) { foreachCol(cell, map, text); } @@ -569,7 +569,7 @@ public final class ExcelExportOfTemplateUtil extends BaseExportService { LOGGER.error(e.getMessage(), e); } } - row.getCell(ci).setCellStyle(columns.get(i).getCellStyle()); + row.getCell(ci).setCellStyle(params.getCellStyle()); // plq modify at 2017-11-13 //判断这个属性是不是需要统计 if (params.isNeedSum()) { templateSumHanlder.addValueOfKey(params.getName(), val);