BAEL-3658: Fixed switch case indentations and added if condition to check if the cellType is FORMULA or not
This commit is contained in:
parent
d2186b0dc7
commit
01a4b4b8a6
@ -48,7 +48,7 @@ public class CellValueAndNotFormulaHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Object getCellValueByEvaluatingFormula(String fileLocation, String cellLocation) throws IOException {
|
public Object getCellValueByEvaluatingFormula(String fileLocation, String cellLocation) throws IOException {
|
||||||
Object cellValue;
|
Object cellValue = new Object();
|
||||||
|
|
||||||
FileInputStream inputStream = new FileInputStream(new File(fileLocation));
|
FileInputStream inputStream = new FileInputStream(new File(fileLocation));
|
||||||
Workbook workbook = new XSSFWorkbook(inputStream);
|
Workbook workbook = new XSSFWorkbook(inputStream);
|
||||||
@ -61,6 +61,7 @@ public class CellValueAndNotFormulaHelper {
|
|||||||
Row row = sheet.getRow(cellAddress.getRow());
|
Row row = sheet.getRow(cellAddress.getRow());
|
||||||
Cell cell = row.getCell(cellAddress.getColumn());
|
Cell cell = row.getCell(cellAddress.getColumn());
|
||||||
|
|
||||||
|
if (cell.getCellType() == CellType.FORMULA) {
|
||||||
switch (evaluator.evaluateFormulaCell(cell)) {
|
switch (evaluator.evaluateFormulaCell(cell)) {
|
||||||
case BOOLEAN:
|
case BOOLEAN:
|
||||||
cellValue = cell.getBooleanCellValue();
|
cellValue = cell.getBooleanCellValue();
|
||||||
@ -74,6 +75,7 @@ public class CellValueAndNotFormulaHelper {
|
|||||||
default:
|
default:
|
||||||
cellValue = null;
|
cellValue = null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
workbook.close();
|
workbook.close();
|
||||||
return cellValue;
|
return cellValue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user