Quantcast
Viewing all articles
Browse latest Browse all 1621

New Post: XSSF issues (ShiftRows, lastRowNumber)

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...

Ehud.

(Post on stackOverflow - http://stackoverflow.com/questions/17763637/xssf-issues-shiftrows-lastrownumber-npoi)

Viewing all articles
Browse latest Browse all 1621

Trending Articles