From b204b0e05a10155d1785e301481390fb82426dfe Mon Sep 17 00:00:00 2001 From: John Underwood Date: Wed, 25 Mar 2020 16:32:56 -0400 Subject: [PATCH] fix bug in AbstractExcelImporter.evalueAllFormulaCells() --- .../plugins/excelimport/AbstractExcelImporter.groovy | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/groovy/org/grails/plugins/excelimport/AbstractExcelImporter.groovy b/src/main/groovy/org/grails/plugins/excelimport/AbstractExcelImporter.groovy index af47bc8..da980ec 100644 --- a/src/main/groovy/org/grails/plugins/excelimport/AbstractExcelImporter.groovy +++ b/src/main/groovy/org/grails/plugins/excelimport/AbstractExcelImporter.groovy @@ -53,15 +53,18 @@ public abstract class AbstractExcelImporter extends imexporter.AbstractImexporte return this } - def evaluateAllFormulaCells() { + def evaluateAllFormulaCells(boolean inCell = false) { for(int sheetNum = 0; sheetNum < workbook.getNumberOfSheets(); sheetNum++) { def sheet = workbook.getSheetAt(sheetNum); for(def r : sheet) { for(def c : r) { - if(c.getCellType() == Cell.CELL_TYPE_FORMULA) { -// if(c.getCellValue()==null || c.getCellValue() == '' || c.getCellValue() == 0){ + if(c.getCellType() == CellType.FORMULA) { + if(inCell) { + evaluator.evaluateInCell(c); + } + else { evaluator.evaluateFormulaCell(c); -// } + } } } }