Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to export cell range to a DataTable

$
0
0

This example illustrates how you can export worksheet cell range to a System.Data.DataTable object.

The following steps are required:

1) Add a reference to the DevExpress.Docs.v13.2.dll assembly to your project containing the SpreadsheetControl. Note that the Universal Subscription or an additional Document Server Subscription is required to distribute this assembly.
2) Create the DevExpress.Spreadsheet.Export.DataTableExporter instance using the DevExpress.Spreadsheet.Worksheet.CreateDataTableExporter method.
3) Call the Export method of the DataTableExporter.

You can create an empty DataTable by using the CreateDataTable method of the DataTableExporter. The column names are obtained from headings of the cell range, and the column data types are extracted from cell data types of the first row of a range.
The DataTableExporter contains various options that enables you to specify how cell data are processed before storing them in a DataTable.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>