大数据表的时侯worksheet.Cells.ExportDataTable非常慢,有没有更快速的办法?

我的导出代码:
Aspose.Cells.LoadOptions opt = new Aspose.Cells.LoadOptions();
opt.LoadFilter = new Aspose.Cells.LoadFilter(Aspose.Cells.LoadDataFilterOptions.CellValue | Aspose.Cells.LoadDataFilterOptions.Style);

opt.MemorySetting = Aspose.Cells.MemorySetting.MemoryPreference;

using (Aspose.Cells.Workbook lswo = new Aspose.Cells.Workbook(filePath, opt))
{
foreach (Aspose.Cells.Worksheet worksheet in lswo.Worksheets)
{
string slsbm = worksheet.Name;
worksheet.Cells.MemorySetting = Aspose.Cells.MemorySetting.MemoryPreference;
worksheet.Cells.DeleteBlankRows();
worksheet.Cells.DeleteBlankColumns();
int totalRows = worksheet.Cells.MaxDataRow + 1;
int maxColumns = worksheet.Cells.MaxDataColumn + 1;
if (maxColumns == 0 || totalRows == 0)
continue;
Aspose.Cells.ExportTableOptions exportTableOptions = new Aspose.Cells.ExportTableOptions();
exportTableOptions.ExportColumnName = true;
exportTableOptions.SkipErrorValue = true;

      System.Data.DataTable dataTable = worksheet.Cells.ExportDataTable(0, 0, worksheet.Cells.MaxRow + 1, worksheet.Cells.MaxDataColumn + 1, exportTableOptions);
     dataTable.TableName = worksheet.Name;
 }

}

@hudaming
For large data set, we are afraid the exporting process is time-consumed and generally it is hard to find better solution for the performance.

For exporting data, the basic processes include creating the table, filling data into the table by traversing the cells. So, maybe you can test the performance of them at first to check whether there is significant difference for time cost between those basic processes and the api of Cells.ExportTableOptions(). If yes, then we need your sample file to look into the performance issue. If not, we are afraid we have no better solution for the performance either. But if your data is special, for example, you know the data exactly such as the type, value, formatting, …etc. We think traversing the cells(such as by apis like GetEnumerator() and filling the cell values into your expected destination directly(memory, database, …) sometimes may give better performance.

这个问题,已经通过其他途径解决掉了

@hudaming
感谢你的反馈。很高兴你的问题通过其他方式得到了解决。如果你有任何疑问,请随时联系我们。