My issue is the duration of reading from worksheet to datatable, not the memory consumption.
Your example of using light cells api is very fast, but the cells of the datatable result are empty.
So I’ve tried to implement my own LightCellsDataHandler and setted all needed interface properties returning true.
Effect of this is that I get the complete datatable, but now it’s slow again as like without using LightCellsDataHandler.
How do I have to implement the LightCellsDataHandler to get the complete datatable inclusive cell values.
Here is my code:
LoadOptions opts = new LoadOptions();
opts.LightCellsDataHandler = new LightCellsDataHandlerVisitCells();
Workbook wb = new Workbook(File, opts);
var dataTable = wb.Worksheets[0].Cells.ExportDataTable(0, 0, _rowCount, _columnCount, false);
class LightCellsDataHandlerVisitCells : LightCellsDataHandler
{
internal LightCellsDataHandlerVisitCells()
{
}
public bool StartSheet(Worksheet sheet)
{
return true;
}
public bool StartRow(int rowIndex)
{
return true;
}
public bool ProcessRow(Row row)
{
return true;
}
public bool StartCell(int columnIndex)
{
return true;
}
public bool ProcessCell(Cell cell)
{
return true;
}
}