Hi Everybody -
See the attached Sample xlsx. My issue is that ExportDataTable is not capturing all the columns on that spreadsheet. Everything after and including the “Account Name” column is not coming back in the DataTable result object.
Here’s the kicker - if I go and resize the “Account Name” column it then is included in the DataTable export correctly.
Has anybody run into this issue? I’ve tried a variety of Export and Load options and haven’t been able to figure it out.
Here is the code I’m using:
//setup export options
var etos = new ExportTableOptions();
etos.ExportAsString = false;
//setup the load options
var lo = new LoadOptions();
lo.LoadDataAndFormatting = false;
//get the workbook
var wb = new Workbook(fileBytes, lo);
//get the worksheet (always the first one)
var ws = wb.Worksheets[0];
//wipe out empty cols
ws.Cells.DeleteBlankColumns();
//wipe out empty rows
ws.Cells.DeleteBlankRows();
//export the worksheet to a DT
DataTable = ws.Cells.ExportDataTable(0, 0, ws.Cells.Rows.Count, ws.Cells.Columns.Count, etos);