https://bz.apache.org/bugzilla/show_bug.cgi?id=59106
Bug ID: 59106
Summary: WorkdayFunction does not read correctly the area with
holidays to calculate work days
Product: POI
Version: 3.13-FINAL
Hardware: PC
Status: NEW
Severity: critical
Priority: P2
Component: XSSF
Assignee: dev@poi.apache.org
Reporter: bondaraw@gmail.com
Created attachment 33618
--> https://bz.apache.org/bugzilla/attachment.cgi?id=33618&action=edit
Excel file with data for testing and Unit test
Package: org.apache.poi.ss.formula.atp
Class: ArgumentsEvaluator
Method: evaluateDatesArg(ValueEval arg, int srcCellRow, int srcCellCol);
Here is the code:
for (int i = area.getFirstRow(); i <= area.getLastRow(); i++) {
for (int j = area.getFirstColumn(); j <= area.getLastColumn(); j++) {
valuesList.add(evaluateDateArg(area.getValue(i, j), i, j));
}
}
i and j stored absolute path.
Method getValue() used relative path. Here is code:
public final ValueEval getValue(int row, int col) {
return getRelativeValue(row, col);
}
WorkdayFunction does not read correctly the area with holidays to calculate
work days. We have debugged it and found that you are using a relating path
(area.getValue()), but you need to use an absolute path
(area.getAbsoluteValue()).
An excel file with data for testing and Unit test is attached.
Please fix it.
--
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
|