}
protected void setCellType(Cell cell, CellType cellType) {
- EvaluationWorkbook evaluationWorkbook = getEvaluationWorkbook();
- BaseXSSFEvaluationWorkbook xewb = BaseXSSFEvaluationWorkbook.class.isAssignableFrom(evaluationWorkbook.getClass()) ? (BaseXSSFEvaluationWorkbook) evaluationWorkbook : null;
-
- ((XSSFCell) cell).setCellType(cellType, xewb);
+ if (cell instanceof XSSFCell) {
+ EvaluationWorkbook evaluationWorkbook = getEvaluationWorkbook();
+ BaseXSSFEvaluationWorkbook xewb = BaseXSSFEvaluationWorkbook.class.isAssignableFrom(evaluationWorkbook.getClass()) ? (BaseXSSFEvaluationWorkbook) evaluationWorkbook : null;
+
+ ((XSSFCell) cell).setCellType(cellType, xewb);
+ } else {
+ // could be an SXSSFCell
+ cell.setCellType(cellType);
+ }
}
}