Worksheet.ExportDataTable

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

Exports data in the Cells collection of a Worksheet to a specifed DataTable object.

public DataTable ExportDataTable(int startRow, int startColumn, int rows, int columns, 
    bool isVertical)
ParameterTypeDescription
startRowInt32The row number of the first cell to export out.
startColumnInt32The column number of the first cell to export out.
rowsInt32Number of rows to be imported.
columnsInt32Number of columns to be imported.
isVerticalBooleanTrue if a row in the control represents a row in DataTable. False if a column in the control represents a row in DataTable.

Return Value

Exported DataTable object.

Remarks

The method permits first create a DataTable object. Then exports data to the DataTable object. If dataTable don’t be set valid, the method will return a new DataTable object by calling overload method ‘Export(bool exportColumnName, bool isVertical)’.

Examples

[C#]

DataTable dataTable = new DataTable();
dataTable.Columns.Add("Column a",System.Type.GetType("System.String"));
dataTable.Columns.Add("Column b");
dataTable.Columns.Add("Column c");
dataTable.Columns.Add("Column d",System.Type.GetType("System.Double"));
dataTable.Columns.Add("Column e",System.Type.GetType("System.Int32"));
dataTable.Columns.Add("Column f",System.Type.GetType("System.Int32"));
DataTable exportTable = gridDesktop.Worksheets[0].Export(dataTable,1,0,10,6,true);
DataGrid1.SetDataBinding(exportTable, null);

[VB]

Dim dataTable As DataTable =  New DataTable() 
dataTable.Columns.Add("Column a",System.Type.GetType("System.String"))
dataTable.Columns.Add("Column b")
dataTable.Columns.Add("Column c")
dataTable.Columns.Add("Column d",System.Type.GetType("System.Double"))
dataTable.Columns.Add("Column e",System.Type.GetType("System.Int32"))
dataTable.Columns.Add("Column f",System.Type.GetType("System.Int32"))
Dim exportTable As DataTable =  GridDesktop.Worksheets(0).Export(dataTable,1,0,10,6,True) 
DataGrid1.SetDataBinding(exportTable)

See Also


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

Exports data in the Cells collection of a Worksheet to a new DataTable object.

public DataTable ExportDataTable(int startRow, int startColumn, int rows, int columns, 
    bool exportColumnName, bool isVertical)
ParameterTypeDescription
startRowInt32The row number of the first cell to export out.
startColumnInt32The column number of the first cell to export out.
rowsInt32Number of rows to be imported.
columnsInt32Number of columns to be imported.
exportColumnNameBooleanIndicates whether the data in the first row are exported to the column name of the DataTable.
isVerticalBooleanTrue if a row in the control represents a row in DataTable. False if a column in the control represents a row in DataTable.

Return Value

Exported DataTable object.

Examples

[C#]

DataTable exportTable = gridDesktop.Worksheets[0].Export(0,0,10,2,true,false);
DataGrid1.SetDataBinding(exportTable, null);

[VB]

Dim exportTable As DataTable =  GridDesktop.Worksheets(0).Export(0,0,10,2,True,False) 
DataGrid1.SetDataBinding(exportTable)

See Also


ExportDataTable(int, int, int, int, GridExportTableOptions)

Exports data in the Cells collection to a DataTable object.

public DataTable ExportDataTable(int firstRow, int firstColumn, int totalRows, int totalColumns, 
    GridExportTableOptions 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.
optionsGridExportTableOptionsAll export table options

Return Value

Exported DataTable object.

See Also