All docs
V19.2
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+
Row

WorksheetExtensions.CreateDataTableExporter(Worksheet, CellRange, DataTable, Boolean) Method

Creates an instance of the data table exporter.

You require a license to the DevExpress Office File API or DevExpress Universal Subscription to use this method in production code.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Docs.v19.2.dll

Declaration

public static DataTableExporter CreateDataTableExporter(
    this Worksheet sheet,
    CellRange range,
    DataTable dataTable,
    bool rangeHasHeaders
)
<ExtensionAttribute>
Public Shared Function CreateDataTableExporter(
    sheet As Worksheet,
    range As CellRange,
    dataTable As DataTable,
    rangeHasHeaders As Boolean
) As DataTableExporter
public static DataTableExporter CreateDataTableExporter(
    this Worksheet sheet,
    CellRange range,
    DataTable dataTable,
    bool rangeHasHeaders
)
<ExtensionAttribute>
Public Shared Function CreateDataTableExporter(
    sheet As Worksheet,
    range As CellRange,
    dataTable As DataTable,
    rangeHasHeaders As Boolean
) As DataTableExporter
public static DataTableExporter CreateDataTableExporter(
    this Worksheet sheet,
    CellRange range,
    DataTable dataTable,
    bool rangeHasHeaders
)
<ExtensionAttribute>
Public Shared Function CreateDataTableExporter(
    sheet As Worksheet,
    range As CellRange,
    dataTable As DataTable,
    rangeHasHeaders As Boolean
) As DataTableExporter

Parameters

Name Type Description
sheet Worksheet

A Worksheet interface for the worksheet which contains data for export.

range CellRange

A CellRange of cells containing data for export.

dataTable DataTable

A DataTable object which will be populated with exported data.

rangeHasHeaders Boolean

true, to skip the first row in the specified range; otherwise, false.

Parameters

Name Type Description
sheet Worksheet

A Worksheet interface for the worksheet which contains data for export.

range CellRange

A CellRange of cells containing data for export.

dataTable DataTable

A DataTable object which will be populated with exported data.

rangeHasHeaders Boolean

true, to skip the first row in the specified range; otherwise, false.

Parameters

Name Type Description
sheet Worksheet

A Worksheet interface for the worksheet which contains data for export.

range CellRange

A CellRange of cells containing data for export.

dataTable DataTable

A DataTable object which will be populated with exported data.

rangeHasHeaders Boolean

true, to skip the first row in the specified range; otherwise, false.

Returns

Type Description
DataTableExporter

A DataTableExporter instance that performs export to a data table.

Returns

Type Description
DataTableExporter

A DataTableExporter instance that performs export to a data table.

Returns

Type Description
DataTableExporter

A DataTableExporter instance that performs export to a data table.

Remarks

Use the CreateDataTableExporter method to create a 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 DataTableExporter is created.

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

See Also