Examples of HSSFEvaluationWorkbook


Examples of org.apache.poi.hssf.usermodel.HSSFEvaluationWorkbook

    Ptg[] ptgs = fRecs[0].getParsedExpression();
    assertEquals(1, ptgs.length);
    assertTrue(ptgs[0] instanceof Ref3DPtg);

    Ref3DPtg ptg = (Ref3DPtg)ptgs[0];
    HSSFEvaluationWorkbook book = HSSFEvaluationWorkbook.create(stubHSSF);
    assertEquals("Sheet1!A1", ptg.toFormulaString(book));


    // Now check we get the right formula back for
    //  a few sample ones
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.HSSFEvaluationWorkbook

  }

  public void testMacroFunction() {
    // testNames.xls contains a VB function called 'myFunc'
    HSSFWorkbook w = HSSFTestDataSamples.openSampleWorkbook("testNames.xls");
    HSSFEvaluationWorkbook book = HSSFEvaluationWorkbook.create(w);

    Ptg[] ptg = HSSFFormulaParser.parse("myFunc()", w);
    // myFunc() actually takes 1 parameter.  Don't know if POI will ever be able to detect this problem

    // the name gets encoded as the first arg
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.HSSFEvaluationWorkbook

  }

  public void testMacroFunction() {
    // testNames.xls contains a VB function called 'myFunc'
    HSSFWorkbook w = HSSFTestDataSamples.openSampleWorkbook("testNames.xls");
    HSSFEvaluationWorkbook book = HSSFEvaluationWorkbook.create(w);

    Ptg[] ptg = HSSFFormulaParser.parse("myFunc()", w);
    // myFunc() actually takes 1 parameter.  Don't know if POI will ever be able to detect this problem

    // the name gets encoded as the first arg
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.HSSFEvaluationWorkbook

    public void testDiscontinousReference() throws Exception {
        InputStream is = HSSFTestDataSamples.openSampleFileStream("44167.xls");
        HSSFWB wb = new HSSFWB(is);
        Workbook workbook = wb.getWorkbook();
        HSSFEvaluationWorkbook eb = HSSFEvaluationWorkbook.create(wb);

        assertEquals(1, wb.getNumberOfNames());
        String sheetName = "Tabelle1";
        String rawRefA = "$C$10:$C$14";
        String rawRefB = "$C$16:$C$18";
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.HSSFEvaluationWorkbook

  }

  public void testMacroFunction() {
    // testNames.xls contains a VB function called 'myFunc'
    HSSFWorkbook w = HSSFTestDataSamples.openSampleWorkbook("testNames.xls");
    HSSFEvaluationWorkbook book = HSSFEvaluationWorkbook.create(w);

    Ptg[] ptg = HSSFFormulaParser.parse("myFunc()", w);
    // myFunc() actually takes 1 parameter.  Don't know if POI will ever be able to detect this problem

    // the name gets encoded as the first arg
View Full Code Here

Examples of org.zkoss.poi.hssf.usermodel.HSSFEvaluationWorkbook

    assertEquals(Cell.CELL_TYPE_ERROR, valueIV3.getCellType());
    testToFormulaString(cellIV3, "SUM(#REF!)");
  }
 
  private void testToFormulaString(Cell cell, String expect) {
    HSSFEvaluationWorkbook evalbook = HSSFEvaluationWorkbook.create((HSSFWorkbook)_workbook);
    Ptg[] ptgs = BookHelper.getCellPtgs(cell);
    final String formula = FormulaRenderer.toFormulaString(evalbook, ptgs);
    assertEquals(expect, formula);
  }
View Full Code Here

Examples of org.zkoss.poi.hssf.usermodel.HSSFEvaluationWorkbook

    assertEquals(Cell.CELL_TYPE_NUMERIC, valueD3.getCellType());
    testToFormulaString(cellD3, "D2");
  }
 
  private void testToFormulaString(Cell cell, String expect) {
    HSSFEvaluationWorkbook evalbook = HSSFEvaluationWorkbook.create((HSSFWorkbook)_workbook);
    Ptg[] ptgs = BookHelper.getCellPtgs(cell);
    final String formula = FormulaRenderer.toFormulaString(evalbook, ptgs);
    assertEquals(expect, formula);
  }
View Full Code Here

Examples of org.zkoss.poi.hssf.usermodel.HSSFEvaluationWorkbook

    testEvaluateExternRef();
    testEvaluateRef3D();
  }
 
  private void testToFormulaString(Cell cell, String expect) {
    HSSFEvaluationWorkbook evalbook = HSSFEvaluationWorkbook.create((HSSFWorkbook)_workbook);
    Ptg[] ptgs = BookHelper.getCellPtgs(cell);
    final String formula = FormulaRenderer.toFormulaString(evalbook, ptgs);
    assertEquals(expect, formula);
  }
View Full Code Here

Examples of org.zkoss.poi.hssf.usermodel.HSSFEvaluationWorkbook

    testToFormulaString(cellI4, "A4");
   
  }
 
  private void testToFormulaString(Cell cell, String expect) {
    HSSFEvaluationWorkbook evalbook = HSSFEvaluationWorkbook.create((HSSFWorkbook)_workbook);
    Ptg[] ptgs = BookHelper.getCellPtgs(cell);
    final String formula = FormulaRenderer.toFormulaString(evalbook, ptgs);
    assertEquals(expect, formula);
  }
View Full Code Here

Examples of org.zkoss.poi.hssf.usermodel.HSSFEvaluationWorkbook

    assertEquals(Cell.CELL_TYPE_NUMERIC, valueA1.getCellType());
    testToFormulaString(cellA1, "SUM(C4:F7)");
  }
 
  private void testToFormulaString(Cell cell, String expect) {
    HSSFEvaluationWorkbook evalbook = HSSFEvaluationWorkbook.create((HSSFWorkbook)_workbook);
    Ptg[] ptgs = BookHelper.getCellPtgs(cell);
    final String formula = FormulaRenderer.toFormulaString(evalbook, ptgs);
    assertEquals(expect, formula);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.