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); -// } + } } } }