Ignore Hidden Columns while Exporting Worksheet Data to Data Table

Contents
[ ]

The following sample code explains the usage of ExportTableOptions.PlotVisibleColumns property in ignoring the hidden columns while exporting the worksheet entire data to the data table.

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
string inputPath = dataDir + "Sample.xlsx";
Workbook workbook = new Workbook(inputPath);
Worksheet worksheet = workbook.Worksheets[0];
ExportTableOptions opts = new ExportTableOptions();
opts.PlotVisibleColumns = true;
int totalRows = worksheet.Cells.MaxRow + 1;
int totalColumns = worksheet.Cells.MaxColumn + 1;
DataTable dt = worksheet.Cells.ExportDataTable(0, 0, totalRows, totalColumns, opts);