Package org.apache.poi.ss.usermodel.FormulaEvaluator

Examples of org.apache.poi.ss.usermodel.FormulaEvaluator.CellValue


    HSSFCell testCell = row.createCell((short)3);
    testCell.setCellFormula("A1");

    HSSFFormulaEvaluator evaluator = new HSSFFormulaEvaluator(sheet, wb);
    evaluator.setCurrentRow(row);
    CellValue cellValue = evaluateWithCycles(wb, sheet, row, testCell);
   
    confirmCycleErrorCode(cellValue);
  }
View Full Code Here


    cell.setCellFormula("B1%");
    row.createCell((short)1).setCellValue(50.0);
   
    HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(sheet, wb);
    fe.setCurrentRow(row);
    CellValue cv;
    try {
      cv = fe.evaluate(cell);
    } catch (RuntimeException e) {
      if(e.getCause() instanceof NullPointerException) {
        throw new AssertionFailedError("Identified bug 44608");
      }
      // else some other unexpected error
      throw e;
    }
    assertEquals(HSSFCell.CELL_TYPE_NUMERIC, cv.getCellType());
    assertEquals(0.5, cv.getNumberValue(), 0.0);
  }
View Full Code Here

TOP

Related Classes of org.apache.poi.ss.usermodel.FormulaEvaluator.CellValue

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.