Package org.zkoss.poi.hssf.record.aggregates

Examples of org.zkoss.poi.hssf.record.aggregates.FormulaRecordAggregate


  }
  private static void setHSSFCellPtgs(HSSFCell cell, Ptg[] ptgs) {
      //tricky! must be after the dummyCell construction or the under aggregate record will not
      //be consistent in sheet and cell
        cell.setCellType(Cell.CELL_TYPE_FORMULA);
      FormulaRecordAggregate agg = (FormulaRecordAggregate) new HSSFCellHelper((HSSFCell)cell).getCellValueRecord();
      FormulaRecord frec = agg.getFormulaRecord();
      frec.setOptions((short) 2);
      frec.setValue(0);

      //only set to default if there is no extended format index already set
      if (agg.getXFIndex() == (short)0) {
        agg.setXFIndex((short) 0x0f);
      }
      agg.setParsedExpression(ptgs);
  }
View Full Code Here


  private static Ptg[] getHSSFPtgs(HSSFCell cell) {
    CellValueRecordInterface vr = new HSSFCellHelper(cell).getCellValueRecord();
    if (!(vr instanceof FormulaRecordAggregate)) {
      throw new IllegalArgumentException("Not a formula cell");
    }
    FormulaRecordAggregate fra = (FormulaRecordAggregate) vr;
    return fra.getFormulaTokens();
  }
View Full Code Here

  private static void shiftHSSFFormulas(PtgShifter shifter, int sheetIndex, Cell cell) {
    CellValueRecordInterface vr = new HSSFCellHelper((HSSFCell)cell).getCellValueRecord();
    if (!(vr instanceof FormulaRecordAggregate)) {
      throw new IllegalArgumentException("Not a formula cell");
    }
    FormulaRecordAggregate fra = (FormulaRecordAggregate) vr;
    Ptg[] ptgs = fra.getFormulaTokens();//getFormulaRecord().getParsedExpression();
    if (shifter.adjustFormula(ptgs, sheetIndex)) {
      fra.setParsedExpression(ptgs);
    }
  }
View Full Code Here

TOP

Related Classes of org.zkoss.poi.hssf.record.aggregates.FormulaRecordAggregate

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.