Skip to content

Commit cb0e3ae

Browse files
authored
Merge pull request #2049 from syncfusion-content/869952-ExportData-Notes
869952 - Modify UG content for using combination of ExcelExportDataTableOptions
2 parents f000d7e + 7b53c35 commit cb0e3ae

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Working with Data | Syncfusion
33
description: Learn how to import data to Excel file from ADO.NET objects, Collections, Array; and how to export data from Excel to ADO.NET objects or collections.
4-
platform: file-Formats
4+
platform: file-formats
55
control: XlsIO
66
documentation: UG
77
---
@@ -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)