Package org.zkoss.poi.xssf.usermodel

Examples of org.zkoss.poi.xssf.usermodel.XSSFEvaluationWorkbook


    private static String getFormulaString(XSSFCell cell){
      String formula = cell.getCellFormula();
        final XSSFSheet sheet = cell.getSheet();

        int sheetIndex = sheet.getWorkbook().getSheetIndex(sheet);
        XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(sheet.getWorkbook());
        Ptg[] ptgs = FormulaParser.parse(formula, fpb, FormulaType.CELL, sheetIndex);
        return FormulaRenderer.toFormulaString(fpb, ptgs);
    }
View Full Code Here


      }
      agg.setParsedExpression(ptgs);
  }
  private static void setXSSFCellPtgs(XSSFCell cell, Ptg[] ptgs) {
    XSSFWorkbook book = (XSSFWorkbook) cell.getSheet().getWorkbook();
        XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(book);
        final String formula = FormulaRenderer.toFormulaString(fpb, ptgs);
        if (formula != null && formula.length() > 0) {
          cell.setCellFormula(formula);
        }
  }
View Full Code Here

            }
        }
  }

  private static String shiftXSSFFormula(XSSFWorkbook book, int sheetIndex, String formula, PtgShifter shifter) {
        XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(book);
        Ptg[] ptgs = FormulaParser.parse(formula, fpb, FormulaType.CELL, sheetIndex);
        String shiftedFmla = null;
        if (shifter.adjustFormula(ptgs, sheetIndex)) {
            shiftedFmla = FormulaRenderer.toFormulaString(fpb, ptgs);
        }
View Full Code Here

TOP

Related Classes of org.zkoss.poi.xssf.usermodel.XSSFEvaluationWorkbook

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.