EPPlus.Core
EPPlus.Core copied to clipboard
Bug: LoadFromDataReader throws an invalid row number error
The LoadFromDataReader will throw an invalid row number error if you try to load an empty table without headers. If you load the empty table with headers then the load will process successfully.
The issue is located in ExcelRangeBase.cs, Line number:1839
return _worksheet.Cells[_fromRow, _fromCol, row - 1, _fromCol + fieldCount - 1];
should be changed to
return _worksheet.Cells[_fromRow, _fromCol, (row <= 1 ? 1 : row - 1), _fromCol + fieldCount - 1];