Closed Ninjanaut closed 3 years ago
@Ninjanaut, great thanks for your reporting and your valuable thoughts, sounds great to me, and it would be great if you could make a PR to fix it
Should be closed by #123 , #124 A new version 1.20.0 should work now, please report if this issue still exists, thanks.
Is your feature request related to a problem? Please describe.
Many times
ExcelHelper.ToDataTable()
returnsDataTable
likeor it does not load
DataTable
at all, because of weirdSystem.IndexOutOfRangeException
, when cell count is for example 5, but row count is 4 (I do not know how to create such an excel, but I attach an example with that exception ExcelWithOutOfRangeException.xlsxDescribe the solution you'd like So I thought an elegant solution would be to extend method signature of
ExcelHelper.ToDataTable()
with maxColumns and removeEmptyRows likeDescribe alternatives you've considered Removing columns and rows can be done later when
DataTable
is already loaded (except that case throwingSystem.IndexOutOfRangeException
) but it requires unnecessary additional loop throughDataTable
and is so common operation that it would be great to have it in one method and not have to write it separately.Additional context if there will be an interest in these features, I'll be happy to send a pull request.