File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Document-Processing/Excel/Excel-Library/NET/Import-Export Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,13 @@ using (ExcelEngine excelEngine = new ExcelEngine())
2525 IWorkbook workbook = application.Workbooks.Open(Path.GetFullPath(@"Data/InputTemplate.xlsx"));
2626 IWorksheet worksheet = workbook.Worksheets[ 0] ;
2727
28- //Read data from the worksheet and Export to the DataTable
29- DataTable customersTable = worksheet.ExportDataTable(worksheet.UsedRange, ExcelExportDataTableOptions.ColumnNames | ExcelExportDataTableOptions.ComputedFormulaValues);
28+ //Read all data from the used range of worksheet and Export to the DataTable
29+ DataTable customersTable = worksheet.ExportDataTable(worksheet.UsedRange, ExcelExportDataTableOptions.ColumnNames | ExcelExportDataTableOptions.ComputedFormulaValues);
30+
31+ IRange range = worksheet.Range["A1:B10"];
32+
33+ //Read specified range from the worksheet and Export to DataTable
34+ DataTable customersTable1 = worksheet.ExportDataTable(range, ExcelExportDataTableOptions.ColumnNames | ExcelExportDataTableOptions.ComputedFormulaValues);
3035}
3136
3237//XlsIO supports binding of exported data table to data grid in Windows Forms, WPF, ASP.NET and ASP.NET MVC platforms alone.
You can’t perform that action at this time.
0 commit comments