You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2014/07/03 15:05:07 UTC
[Bug 56420] Sumif throws NullPointerException
https://issues.apache.org/bugzilla/show_bug.cgi?id=56420
--- Comment #2 from Marc S. <ma...@cf.gouv.qc.ca> ---
I've got the same issu.
I add the attachment "test.xlsx", where you can find :
__|__A__|__B__|__C__|__D__|__...__|
_1|a | 1| | | |
_2|b | 2| | | |
_3| | | 0| | |
_4|d | 3| | | |
_5| | | | | |
The formula is in C3 : =SUMIF($A$1:$A$4;A3;$B$1:$B$4)
He here is the code to get the NullPointerException :
private static void POI_sumif() throws IOException {
Workbook wb = new XSSFWorkbook(new FileInputStream(new
File("C:/Temp/test.xlsx")));
FormulaEvaluator evaluator = wb.getCreationHelper()
.createFormulaEvaluator();
try {
Cell c = wb.getSheetAt(0).getRow(2).getCell(2);
System.out.println(c.getCellFormula());
evaluator.evaluateInCell(c);
} catch (Exception e) {
e.printStackTrace();
}
}
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org