Cells.ExportDataTable

ExportDataTable(int, int, int, int)

Exports data in the Cells collection to a DataTable object.

public DataTable ExportDataTable(int firstRow, int firstColumn, int totalRows, int totalColumns)
ParameterTypeDescription
firstRowInt32The row number of the first cell to export out.
firstColumnInt32The column number of the first cell to export out.
totalRowsInt32Number of rows to be imported.
totalColumnsInt32Number of columns to be imported.

Return Value

Exported DataTable object.

Remarks

If you use this method to export a block of data, please be sure that the data in a column should be the same data type. Otherwise, use the ExportDataTableAsString method instead.

Examples

[C#]


string designerFile = "List.xls";
Workbook excel = new Workbook(designerFile);
Worksheet sheet = excel.Worksheets[0];
DataTable dt = sheet.Cells.ExportDataTable(6, 1, 69, 4);

[Visual Basic]


Dim designerFile As String = "List.xls"
Dim excel As excel = New excel(designerFile)
Dim sheet As Worksheet = excel.Worksheets(0)
Dim dt As DataTable = sheet.Cells.ExportDataTable(6, 1, 69, 4)

See Also


ExportDataTable(int, int, int, int, bool)

Exports data in the Cells collection to a DataTable object.

public DataTable ExportDataTable(int firstRow, int firstColumn, int totalRows, int totalColumns, 
    bool exportColumnName)
ParameterTypeDescription
firstRowInt32The row number of the first cell to export out.
firstColumnInt32The column number of the first cell to export out.
totalRowsInt32Number of rows to be imported.
totalColumnsInt32Number of columns to be imported.
exportColumnNameBooleanIndicates whether the data in the first row are exported to the column name of the DataTable.

Return Value

Exported DataTable object.

See Also


ExportDataTable(int, int, int, int, ExportTableOptions)

Exports data in the Cells collection to a DataTable object.

public DataTable ExportDataTable(int firstRow, int firstColumn, int totalRows, int totalColumns, 
    ExportTableOptions options)
ParameterTypeDescription
firstRowInt32The row number of the first cell to export out.
firstColumnInt32The column number of the first cell to export out.
totalRowsInt32Number of rows to be imported.
totalColumnsInt32Number of columns to be imported.
optionsExportTableOptionsAll export table options

Return Value

Exported DataTable object.

See Also