[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Collapse]Office File API
  Demo Application
  Redistribution and Deployment
 [Expand]Spreadsheet Document API
 [Expand]Word Processing Document API
 [Expand]PDF Document API
 [Expand]Excel Export Library
 [Expand]Snap Report API
 [Expand]Zip Compression and Archive API
 [Expand]Barcode Generation API
 [Expand]Unit Conversion API
 [Collapse]API Reference
  [Expand]DevExpress.BarCodes
  [Expand]DevExpress.Compression
  [Expand]DevExpress.Docs.Text
  [Expand]DevExpress.Pdf
  [Expand]DevExpress.Snap
  [Collapse]DevExpress.Spreadsheet
   [Expand]Workbook Class
   [Expand]WorkbookExtensions Class
   [Collapse]WorksheetExtensions Class
     WorksheetExtensions Members
    [Collapse]WorksheetExtensions Methods
     [Expand]CreateDataTable Method
      CreateDataTableExporter Method
     [Expand]Import Method
  [Expand]DevExpress.Spreadsheet.Export
  [Expand]DevExpress.UnitConversion
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

WorksheetExtensions.CreateDataTableExporter Method

Creates an instance of the data table exporter.

Use of this method in production code requires a license to the DevExpress Office File API or the DevExpress Universal Subscription.

Namespace:DevExpress.Spreadsheet
Assembly:DevExpress.Docs.v18.1.dll

Expanded Syntax

Parameters

sheet
Type: Worksheet
A DevExpress.Spreadsheet.Worksheet interface for the worksheet which contains data for export.
range
Type: Range
A DevExpress.Spreadsheet.Range of cells containing data for export.
dataTable
Type: DataTable
A System.Data.DataTable object which will be populated with exported data.
rangeHasHeaders
Type: Boolean
true, to skip the first row in the specified range; otherwise, false.

Return value

Type: DataTableExporter
A DevExpress.Spreadsheet.Export.DataTableExporter instance that performs export to a data table.

Expanded Remarks

Use the CreateDataTableExporter method to create a DevExpress.Spreadsheet.Export.DataTableExporter which is the key object of the data export.

Note

When calling the CreateDataTableExporter method, make sure that the number of data columns in the specified dataTable is the same as the number of columns in the specified range; otherwise, a System.ArgumentException will be thrown.

Therefore, if you need to add an additional column to the data table (e.g., an auto-incremented or computed column), you should do it only after DevExpress.Spreadsheet.Export.DataTableExporter is created.

Use the CreateDataTable method to create a data table that corresponds to the specified worksheet cell range.

Expanded See Also

Is this topic helpful?​​​​​​​