Cells.ImportDataTable

ImportDataTable(DataTable, bool, string)

Imports a DataTable object into a worksheet.

[Obsolete("Use Cells.ImportData(DataTable,int,int,ImportTableOptions) method, instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public int ImportDataTable(DataTable dataTable, bool isFieldNameShown, string startCell)
ParameterTypeDescription
dataTableDataTableThe DataTable object to be imported.
isFieldNameShownBooleanIndicates whether the field name of the datatable will be imported to the first row.
startCellStringThe name of start cell to insert the DataTable, such as “A2”.

Return Value

Total number of rows imported

Remarks

NOTE: This member is now obsolete. Instead, please use Cells.ImportData(DataTable,int,int,ImportTableOptions) method, instead. This property will be removed 12 months later since December 2018. Aspose apologizes for any inconvenience you may have experienced.

See Also


ImportDataTable(DataTable, bool, int, int, bool, bool)

Imports a DataTable object into a worksheet.

[Obsolete("Use Cells.ImportData(DataTable,int,int,ImportTableOptions) method, instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public int ImportDataTable(DataTable dataTable, bool isFieldNameShown, int firstRow, 
    int firstColumn, bool insertRows, bool convertStringToNumber)
ParameterTypeDescription
dataTableDataTableThe DataTable object to be imported.
isFieldNameShownBooleanIndicates whether the field name of the datatable will be imported to the first row. Default is true.
firstRowInt32The row number of the first cell to import.
firstColumnInt32The column number of the first cell to import.
insertRowsBooleanIndicates whether extra rows are added to fit data.
convertStringToNumberBooleanIndicates if this method will try to convert string to number.

Return Value

Total number of rows imported

Remarks

NOTE: This member is now obsolete. Instead, please use Cells.ImportData(DataTable,int,int,ImportTableOptions) method, instead. This property will be removed 12 months later since December 2018. Aspose apologizes for any inconvenience you may have experienced.

See Also


ImportDataTable(DataTable, bool, int, int)

Imports a DataTable object into a worksheet.

[Obsolete("Use Cells.ImportData(DataTable,int,int,ImportTableOptions) method, instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public int ImportDataTable(DataTable dataTable, bool isFieldNameShown, int firstRow, 
    int firstColumn)
ParameterTypeDescription
dataTableDataTableThe DataTable object to be imported.
isFieldNameShownBooleanIndicates whether the field name of the datatable will be imported to the first row. Default is true.
firstRowInt32The row number of the first cell to import.
firstColumnInt32The column number of the first cell to import.

Return Value

Total number of rows imported

Remarks

NOTE: This member is now obsolete. Instead, please use Cells.ImportData(DataTable,int,int,ImportTableOptions) method, instead. This property will be removed 12 months later since December 2018. Aspose apologizes for any inconvenience you may have experienced.

See Also


ImportDataTable(DataTable, bool, int, int, bool)

Imports a DataTable object into a worksheet.

[Obsolete("Use Cells.ImportData(DataTable,int,int,ImportTableOptions) method, instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public int ImportDataTable(DataTable dataTable, bool isFieldNameShown, int firstRow, 
    int firstColumn, bool insertRows)
ParameterTypeDescription
dataTableDataTableThe DataTable object to be imported.
isFieldNameShownBooleanIndicates whether the field name of the datatable will be imported to the first row. Default is true.
firstRowInt32The row number of the first cell to import.
firstColumnInt32The column number of the first cell to import.
insertRowsBooleanIndicates whether extra rows are added to fit data.

Return Value

Total number of rows imported

Remarks

NOTE: This member is now obsolete. Instead, please use Cells.ImportData(DataTable,int,int,ImportTableOptions) method, instead. This property will be removed 12 months later since December 2018. Aspose apologizes for any inconvenience you may have experienced.

See Also


ImportDataTable(DataTable, bool, int, int, int, int)

Imports a DataTable into a worksheet.

[Obsolete("Use Cells.ImportData(DataTable,int,int,ImportTableOptions) method, instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public int ImportDataTable(DataTable dataTable, bool isFieldNameShown, int firstRow, 
    int firstColumn, int totalRows, int totalColumns)
ParameterTypeDescription
dataTableDataTableThe DataTable object to be imported.
isFieldNameShownBooleanIndicates whether the field name of the datatable will be imported to the first row. Default is true.
firstRowInt32The row number of the first cell to import in.
firstColumnInt32The column number of the first cell to import in.
totalRowsInt32Number of rows to be imported.
totalColumnsInt32Number of columns to be imported.

Return Value

Total number of rows imported

Remarks

NOTE: This member is now obsolete. Instead, please use Cells.ImportData(DataTable,int,int,ImportTableOptions) method, instead. This property will be removed 12 months later since December 2018. Aspose apologizes for any inconvenience you may have experienced.

Examples


[C#]
Workbook excel = new Workbook();
Cells cells = excel.Worksheets[0].Cells;

DataTable dt = new DataTable("Employee");
dt.Columns.Add("Employee_ID",typeof(Int32));
dt.Columns.Add("Employee_Name",typeof(string));
dt.Columns.Add("Gender",typeof(string));
DataRow dr = dt.NewRow();
dr[0] = 1;
dr[1] = "John Smith";
dr[2] = "Male";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = 2;
dr[1] = "Mary Miller";
dr[2] = "Female";
dt.Rows.Add(dr);
ImportTableOptions options = new ImportTableOptions();
options.IsFieldNameShown = true;
cells.ImportData(dt, 12, 12, options);

[Visual Basic]
Dim excel as Workbook = new Workbook()
Dim cells as Cells = excel.Worksheets(0).Cells
Dim dt As DataTable =  New DataTable("Employee") 
dt.Columns.Add("Employee_ID",Type.GetType(Int32))
dt.Columns.Add("Employee_Name",Type.GetType(String))
dt.Columns.Add("Gender",Type.GetType(String))
Dim dr As DataRow =  dt.NewRow() 
dr(0) = 1
dr(1) = "John Smith"
dr(2) = "Male"
dt.Rows.Add(dr)
dr = dt.NewRow()
dr(0) = 2
dr(1) = "Mary Miller"
dr(2) = "Female"
dt.Rows.Add(dr)
Dim options as ImportTableOptions = new ImportTableOptions()
options.IsFieldNameShown = True
cells.ImportData(dt, 12, 12, options)

See Also


ImportDataTable(DataTable, bool, int, int, int, int, bool, string)

Imports a DataTable into a worksheet.

[Obsolete("Use Cells.ImportData(DataTable,int,int,ImportTableOptions) method, instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public int ImportDataTable(DataTable dataTable, bool isFieldNameShown, int firstRow, 
    int firstColumn, int rowNumber, int columnNumber, bool insertRows, string dateFormatString)
ParameterTypeDescription
dataTableDataTableThe DataTable object to be imported.
isFieldNameShownBooleanIndicates whether the field name of the datatable will be imported to the first row. Default is true.
firstRowInt32The row number of the first cell to import in.
firstColumnInt32The column number of the first cell to import in.
rowNumberInt32Number of rows to be imported.
columnNumberInt32Number of columns to be imported.
insertRowsBooleanIndicates whether extra rows are added to fit data.
dateFormatStringStringDate format string for cells.

Return Value

Total number of rows imported.

Remarks

This method automatically format date time values. However, if the DateTable is very huge, this method may slow down the program. In this case, you’d better format the cell manually.

NOTE: This member is now obsolete. Instead, please use Cells.ImportData(DataTable,int,int,ImportTableOptions) method, instead. This property will be removed 12 months later since December 2018. Aspose apologizes for any inconvenience you may have experienced.

See Also


ImportDataTable(DataTable, bool, int, int, int, int, bool, string, bool)

Imports a DataTable into a worksheet.

[Obsolete("Use Cells.ImportData(DataTable,int,int,ImportTableOptions) method, instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public int ImportDataTable(DataTable dataTable, bool isFieldNameShown, int firstRow, 
    int firstColumn, int rowNumber, int columnNumber, bool insertRows, string dateFormatString, 
    bool convertStringToNumber)
ParameterTypeDescription
dataTableDataTableThe DataTable object to be imported.
isFieldNameShownBooleanIndicates whether the field name of the datatable will be imported to the first row. Default is true.
firstRowInt32The row number of the first cell to import in.
firstColumnInt32The column number of the first cell to import in.
rowNumberInt32Number of rows to be imported.
columnNumberInt32Number of columns to be imported.
insertRowsBooleanIndicates whether extra rows are added to fit data.
dateFormatStringStringDate format string for cells.
convertStringToNumberBooleanIndicates if this method will try to convert string to number.

Return Value

Total number of rows imported.

Remarks

This method automatically format date time values. However, if the DateTable is very huge, this method may slow down the program. In this case, you’d better format the cell manually.

NOTE: This member is now obsolete. Instead, please use Cells.ImportData(DataTable,int,int,ImportTableOptions) method, instead. This property will be removed 12 months later since December 2018. Aspose apologizes for any inconvenience you may have experienced.

See Also


ImportDataTable(DataTable, bool, int, int, int, int, bool)

Imports a DataTable into a worksheet.

[Obsolete("Use Cells.ImportData(DataTable,int,int,ImportTableOptions) method, instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public int ImportDataTable(DataTable dataTable, bool isFieldNameShown, int firstRow, 
    int firstColumn, int rowNumber, int columnNumber, bool insertRows)
ParameterTypeDescription
dataTableDataTableThe DataTable object to be imported.
isFieldNameShownBooleanIndicates whether the field name of the datatable will be imported to the first row. Default is true.
firstRowInt32The row number of the first cell to import in.
firstColumnInt32The column number of the first cell to import in.
rowNumberInt32Number of rows to be imported.
columnNumberInt32Number of columns to be imported.
insertRowsBooleanIndicates whether extra rows are added to fit data.

Return Value

Total number of rows imported.

Remarks

NOTE: This member is now obsolete. Instead, please use Cells.ImportData(DataTable,int,int,ImportTableOptions) method, instead. This property will be removed 12 months later since December 2018. Aspose apologizes for any inconvenience you may have experienced.

See Also