You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
string inputFile = "input.xls";
IWorkbook workbook;
using (FileStream file = new FileStream(inputFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
workbook = new HSSFWorkbook(file);
}
ISheet sheet = workbook.GetSheetAt(0);
Console.WriteLine(sheet.LastRowNum);
Console.WriteLine(sheet.PhysicalNumberOfRows);
sheet.ShiftRows(3, sheet.LastRowNum, -1);
Console.WriteLine(sheet.LastRowNum);
Console.WriteLine(sheet.PhysicalNumberOfRows);
string outputFile = "output.xls";
using (FileStream file = new FileStream(outputFile, FileMode.Create, FileAccess.Write))
{
workbook.Write(file);
}
Issue Description
As shown in the code above, after I moved all rows below the third row up by one, the sheet.LastRowNum decreased by 1, but the sheet.PhysicalNumberOfRows remained unchanged.
Unlike XSSFWorkbook, where both sheet.LastRowNum and sheet.PhysicalNumberOfRows decrease by 1.
The text was updated successfully, but these errors were encountered:
NPOI Version
2.7.1
File Type
Upload the Excel File
input.xls
Reproduce Steps
Issue Description
As shown in the code above, after I moved all rows below the third row up by one, the
sheet.LastRowNum
decreased by 1, but thesheet.PhysicalNumberOfRows
remained unchanged.Unlike XSSFWorkbook, where both
sheet.LastRowNum
andsheet.PhysicalNumberOfRows
decrease by 1.The text was updated successfully, but these errors were encountered: