|Summary:||Subtotal is not return correct value.|
|Product:||POI||Reporter:||Shunji Konishi <shun.konishi>|
|Component:||POI Overall||Assignee:||POI Developers List <dev>|
|Attachments:||Test of Subtotal function|
Description Shunji Konishi 2012-06-19 09:57:07 UTC
I think, because LazyAreaEval#isSubtotal is not considered to relative index. I corrected LazyAreaEval.java in my local environment, is as follows. --- return _evaluator.isSubTotal(rowIndex, columnIndex); +++ return _evaluator.isSubTotal(getFirstRow() + rowIndex, getFirstColumn() + columnIndex); After that, it seems to work correctly. Please check. Regards.
Comment 1 Yegor Kozlov 2012-06-19 10:43:27 UTC
Can you please upload a unit test that demonstrates what is wrong and proves that you patch fixes it ? Yegor
Comment 2 Shunji Konishi 2012-06-20 05:23:02 UTC
Created attachment 28964 [details] Test of Subtotal function Hi, I modified TestSubtotal.java, and attached it. Diff please. Unfortunately, All of original subtotal tests are start with "A1" cell. The offset of "A1" is (0, 0). Therefore, the offset did not affect the results. My changes are simple. I modified all of start cell to "B2". As a result, original source failed test, and my change succeed. regards.
Comment 3 Yegor Kozlov 2012-06-20 07:10:01 UTC
Thanks. Something to work for me in the POI-3.9 dev cycle. Regards, Yegor (In reply to comment #2) > Created attachment 28964 [details] > Test of Subtotal function > > Hi, > I modified TestSubtotal.java, and attached it. > > Diff please. > > Unfortunately, All of original subtotal tests are start with "A1" cell. > The offset of "A1" is (0, 0). > Therefore, the offset did not affect the results. > > My changes are simple. > I modified all of start cell to "B2". > > As a result, original source failed test, and my change succeed. > > regards.