多Sheet XLSX文件,MiniExcel读取数据时间过长
Excel Type
- [✔ ] XLSX
- [ ] XLSM
- [ ] CSV
- [ ] OTHER
Upload Excel File
Please attach your issue file by dragging or droppng, selecting or pasting them.
MiniExcel Version
Description
这个Excel文件,如果修改每个sheet的title公司名称,读取可以在2秒以内完成,原文件需要>40秒才能成功读取
下面是读取XLSX文件代码
OpenXmlConfiguration configuration = new OpenXmlConfiguration() { FillMergedCells = true };
var source_Rows = MiniExcel.Query(stream, configuration: configuration).ToList();
Ok so actually this is happening because your excel file is malformed, sort of. It turns out that even though all columns past N are empty, for some reason the worksheet's horizontal dimension is maxed out, maybe because of the background color of the cells. This means that you were trying to query 15k+ columns, that's why it was taking so long. We might add the option for an upper bound in the future, but for the time being you can use MiniExcel.QueryRange or just copy the data in a clean sheet and query from there.