Uploaded image for project: 'ZK Spreadsheet'
  1. ZK Spreadsheet
  2. ZSS-873

Import formula cache result from an Excel file


    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Normal Normal
    • 3.7.0
    • 3.6.0
    • None
    • Security Level: Jimmy
    • None

      Problem Description

      Currently, ZSS importer doesn't import Excel formula cache and formula evaluation might take long time when loading an Excel file with massive formulas.


      Use Case:
      Users want to find all cells with error value, this procedure takes long time because it causes formula evalution to get error result.

      To set formula cache result for those cells with a formula error during importing.
      Because in org.zkoss.zss.model.impl.CellImpl.evalFormula(), if _formulaResultValue!=null, it won't continue to evaluate a formula.

      public class FormulaErrorCacheImporter extends ExcelXlsxImporter {
      	protected SCell importCell(Cell poiCell, int row, SSheet sheet) {
      		SCell cell = super.importCell(poiCell, row, sheet);
      		if (poiCell.getCellType() == Cell.CELL_TYPE_FORMULA
      				&& poiCell.getCachedFormulaResultType() == Cell.CELL_TYPE_ERROR) {
      		return cell;

            Jenkins Jenkins
            hawk hawk
            0 Vote for this issue
            0 Start watching this issue