Quantcast
Channel: NPOI
Viewing all articles
Browse latest Browse all 1621

Created Unassigned: ISheet.RemoveRow(IRow) causes corrupt xlsx [13639]

$
0
0
Hello

I ran into an issue using the RemoveRow method.. it corrupts my xlsx files every time.

Can anyone confirm this behaviour?

Here's my code to delete a row:

```
public static void DeleteRow(ISheet sheet, int rowIndex)
{
int lastRowNum = sheet.LastRowNum;

if (rowIndex >= 0 && rowIndex < lastRowNum)
{
sheet.ShiftRows(rowIndex + 1, lastRowNum, -1);
}

if (rowIndex == lastRowNum)
{
var removingRow = sheet.GetRow(rowIndex);
if (removingRow != null)
{
sheet.RemoveRow(removingRow); // BUG: causes the xlsx to be currupt!
}
}
}
```

Thanks for any feedback

Viewing all articles
Browse latest Browse all 1621

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>