mardi 24 juin 2014

NPOI: Sheet.RemoveRow is throwing exception "Situation not covered: (59, 1543, -1, 34, 58)


Vote count:

0




I'm trying to remove rows using the following code:



public void RemoveRows(string rangeName, int rowIndex)
{
ISheet sheet = GetSheetByNamedRange(rangeName);
if (sheet != null)
{
IRow row = sheet.GetRow(rowIndex);
if (row != null)
{
sheet.RemoveRow(row);
int lastRowIdx = sheet.LastRowNum;
if (rowIndex >= 0 && rowIndex < lastRowIdx)
{
sheet.ShiftRows(rowIndex + 1, lastRowIdx, -1);//Exception
//here...
}
}
}
}


I'm getting the following Situation not covered: (59, 1543, -1, 34, 58). And when the exception is thrown, rowIndex = 58, lastRowIdx = 1543.


I've done extensive research to find out the source of the problem, but not luck.


Thanks for helping.



asked 33 secs ago

Richard77

3,221





Aucun commentaire:

Enregistrer un commentaire