Hi,
We have found that “Transition formula evaluation” option does not work properly for the documents in Excel 97-2003 binary format. The code looks as follows:
public class Test1 {
public class CustomFunction implements ICustomFunction
{
@Override
public Object calculateCustomFunction(String functionName, ArrayList paramsList, ArrayList contextObjects) {
return “”;
}
}
public void testTransitionEvaluation() throws Exception {
Workbook workbook = new Workbook(“D:\test.xls”);
Worksheet worksheet = workbook.getWorksheets().get(0);
Cells cells = worksheet.getCells();
Cell cell = cells.get(2, 0);
worksheet.setTransitionEvaluation(true);
CustomFunction customFunction = new CustomFunction();
cell.calculate(true, customFunction);
System.out.println("formula: " + cell.getFormula());
System.out.println("value: " + cell.getStringValue());
}
}
Output looks as follows:
formula: =A1-A2
value: #VALUE!
This bug is not reproducible for the documents in 2007-2013 OpenXML format. If you replace in test code input file “test.xls” on “test.xlsx” from the attachment, output is correct and looks as follows:
formula: =A1-A2
value: 1
Could you fix this bug for the documents in Excel 97-2003 binary format?
Thanks.