Skip to content

Commit cf137f3

Browse files
committed
869952-ExportData-Notes
1 parent bd89cb0 commit cf137f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

File-Formats/XlsIO/Working-with-Data.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,7 +2244,7 @@ using (ExcelEngine excelEngine = new ExcelEngine())
22442244
IWorksheet worksheet = workbook.Worksheets[0];
22452245

22462246
//Read data from the worksheet and Export to the DataTable
2247-
DataTable customersTable = worksheet.ExportDataTable(worksheet.UsedRange, ExcelExportDataTableOptions.ColumnNames);
2247+
DataTable customersTable = worksheet.ExportDataTable(worksheet.UsedRange, ExcelExportDataTableOptions.ColumnNames | ExcelExportDataTableOptions.ComputedFormulaValues);
22482248

22492249
//Saving the workbook as stream
22502250
FileStream stream = new FileStream("ExportToDT.xlsx", FileMode.Create, FileAccess.ReadWrite);
@@ -2264,7 +2264,7 @@ using (ExcelEngine excelEngine = new ExcelEngine())
22642264
IWorksheet worksheet = workbook.Worksheets[0];
22652265

22662266
//Read data from the worksheet and Export to the DataTable
2267-
DataTable customersTable = worksheet.ExportDataTable(worksheet.UsedRange, ExcelExportDataTableOptions.ColumnNames);
2267+
DataTable customersTable = worksheet.ExportDataTable(worksheet.UsedRange, ExcelExportDataTableOptions.ColumnNames | ExcelExportDataTableOptions.ComputedFormulaValues);
22682268

22692269
//Binding exported DataTable to data grid, likewise it can binded to any
22702270
//user interface control which supports binding
@@ -2283,7 +2283,7 @@ Using excelEngine As ExcelEngine = New ExcelEngine()
22832283
Dim sheet As IWorksheet = workbook.Worksheets(0)
22842284

22852285
'Read data from the worksheet and Export to the DataTable
2286-
Dim customersTable As DataTable = sheet.ExportDataTable(sheet.UsedRange, ExcelExportDataTableOptions.ColumnNames)
2286+
Dim customersTable As DataTable = sheet.ExportDataTable(sheet.UsedRange, ExcelExportDataTableOptions.ColumnNames Or ExcelExportDataTableOptions.ComputedFormulaValues)
22872287

22882288
'Binding exported DataTable to data grid, likewise it can binded to any
22892289
'user interface control which supports binding

0 commit comments

Comments
 (0)