Search in sources :

Example 1 with CalculateMortgageFunction

use of org.apache.poi.ss.examples.formula.CalculateMortgageFunction in project poi by apache.

the class TestExcelAntWorkbookUtil method testGetEvaluatorXLSXWithFunction.

public void testGetEvaluatorXLSXWithFunction() {
    fixture = new ExcelAntWorkbookUtilTestHelper(BuildFileTest.getDataDir() + "/spreadsheet/sample.xlsx");
    fixture.addFunction("h2_ZFactor", new CalculateMortgageFunction());
    FormulaEvaluator evaluator = fixture.getEvaluator(BuildFileTest.getDataDir() + "/spreadsheet/sample.xlsx");
    assertNotNull(evaluator);
}
Also used : CalculateMortgageFunction(org.apache.poi.ss.examples.formula.CalculateMortgageFunction) FormulaEvaluator(org.apache.poi.ss.usermodel.FormulaEvaluator)

Example 2 with CalculateMortgageFunction

use of org.apache.poi.ss.examples.formula.CalculateMortgageFunction in project poi by apache.

the class TestExcelAntWorkbookUtil method testAddFunction.

public void testAddFunction() {
    fixture = new ExcelAntWorkbookUtilTestHelper(mortgageCalculatorFileName);
    assertNotNull(fixture);
    fixture.addFunction("h2_ZFactor", new CalculateMortgageFunction());
    UDFFinder functions = fixture.getFunctions();
    assertNotNull(functions);
    assertNotNull(functions.findFunction("h2_ZFactor"));
}
Also used : CalculateMortgageFunction(org.apache.poi.ss.examples.formula.CalculateMortgageFunction) UDFFinder(org.apache.poi.ss.formula.udf.UDFFinder)

Example 3 with CalculateMortgageFunction

use of org.apache.poi.ss.examples.formula.CalculateMortgageFunction in project poi by apache.

the class TestExcelAntWorkbookUtil method testGetEvaluatorWithUDF.

public void testGetEvaluatorWithUDF() {
    fixture = new ExcelAntWorkbookUtilTestHelper(mortgageCalculatorFileName);
    fixture.addFunction("h2_ZFactor", new CalculateMortgageFunction());
    FormulaEvaluator evaluator = fixture.getEvaluator(mortgageCalculatorFileName);
    assertNotNull(evaluator);
}
Also used : CalculateMortgageFunction(org.apache.poi.ss.examples.formula.CalculateMortgageFunction) FormulaEvaluator(org.apache.poi.ss.usermodel.FormulaEvaluator)

Aggregations

CalculateMortgageFunction (org.apache.poi.ss.examples.formula.CalculateMortgageFunction)3 FormulaEvaluator (org.apache.poi.ss.usermodel.FormulaEvaluator)2 UDFFinder (org.apache.poi.ss.formula.udf.UDFFinder)1