This project is read-only.

XSSF issues (ShiftRows, lastRowNumber)

Jul 20, 2013 at 4:08 PM
Edited Jul 20, 2013 at 4:14 PM
Hi everyone,

I had a long time need for such a library, and i had the luck to stumble upon this one.

I would like to share some issues, not sure if they are bugs (or features..), that might save some people some time.

1/ i use the library to clean some unwanted stuff from a sheet before opening it using oledb and dumping it to the DB. I do it by iterating over the rows and deleting the unwanted ones. I do it using shiftRows.

I began with writing a code for xls files, using HSSF, which worked perfectly.

I then just changed the sheet type to XSSF. In short, i discovered that it will only work if after each rowShift i set the ForceFormulaRecalculation to true.

2/ The lastRowNumber isnt correct. If i open the original excel file in excel, i see that the last row is row 112, but when im debugging, i get 111. Also, when i try to shift the 112 row, i get outOfBounds exception.

Im using NPOI 2.0 beta 1 (.NET Framework 4), coding in C#.

Hope it will save you some precious daylight...


(Post on stackOverflow -
Nov 18, 2013 at 12:23 AM
There are some bugs in ShiftRows in NPOI 2.0 beta 1.