Class DataTableFormatProvider
Converts between ADO.NET DataTable instances and spreadsheet workbooks, enabling bidirectional data exchange for tabular data integration.
Inheritance
Inherited Members
Namespace: Telerik.Windows.Documents.Spreadsheet.FormatProviders
Assembly: Telerik.Windows.Documents.Spreadsheet.dll
Syntax
public class DataTableFormatProvider
Constructors
DataTableFormatProvider()
Initializes a new instance of the DataTableFormatProvider class with default import and export settings.
Declaration
public DataTableFormatProvider()
Properties
ExportSettings
Gets or sets the settings controlling how worksheet data is exported to DataTable.
Declaration
public DataTableFormatProviderExportSettings ExportSettings { get; set; }
Property Value
|
DataTableFormatProviderExportSettings
|
ImportSettings
Gets or sets the settings controlling how DataTable data is imported into worksheets.
Declaration
public DataTableFormatProviderImportSettings ImportSettings { get; set; }
Property Value
|
DataTableFormatProviderImportSettings
|
Methods
Export(Worksheet)
Exports the specified worksheet to a new DataTable, converting cell values and types according to export settings.
Declaration
public DataTable Export(Worksheet worksheet)
Parameters
|
Worksheet
worksheet
The worksheet for export. |
Returns
|
System.Data.DataTable
the converted DataTable |
Export(Worksheet, Nullable<TimeSpan>)
Exports the specified worksheet to a new DataTable, converting cell values and types according to export settings.
Declaration
public DataTable Export(Worksheet worksheet, TimeSpan? timeout)
Parameters
|
Worksheet
worksheet
The worksheet for export. |
|
System.Nullable<System.TimeSpan>
timeout
The timeout after which the operation will be cancelled. |
Returns
|
System.Data.DataTable
the converted DataTable |
Exceptions
|
System.ArgumentOutOfRangeException
The exception that is thrown when timeout is less than -1 or greater than Int32.MaxValue. Note that this upper bound is more restrictive than TimeSpan.MaxValue. |
Import(DataTable)
Imports the specified DataTable into a new workbook, creating a worksheet with the table data.
Declaration
public Workbook Import(DataTable table)
Parameters
|
System.Data.DataTable
table
The DataTable for import. |
Returns
|
Workbook
the converted new Workbook. |
Import(DataTable, Nullable<TimeSpan>)
Imports the specified DataTable into a new workbook, creating a worksheet with the table data.
Declaration
public Workbook Import(DataTable table, TimeSpan? timeout)
Parameters
|
System.Data.DataTable
table
The DataTable for import. |
|
System.Nullable<System.TimeSpan>
timeout
The timeout after which the operation will be cancelled. |
Returns
|
Workbook
the converted new Workbook. |
Exceptions
|
System.ArgumentOutOfRangeException
The exception that is thrown when timeout is less than -1 or greater than Int32.MaxValue. Note that this upper bound is more restrictive than TimeSpan.MaxValue. |
Import(DataTable, Worksheet)
Imports the specified DataTable into an existing worksheet, appending data at the configured start position.
Declaration
public void Import(DataTable table, Worksheet worksheet)
Parameters
|
System.Data.DataTable
table
The DataTable for import. |
|
Worksheet
worksheet
The Worksheet where the data should be added. |
Import(DataTable, Worksheet, Nullable<TimeSpan>)
Imports the specified DataTable into an existing worksheet, appending data at the configured start position.
Declaration
public void Import(DataTable table, Worksheet worksheet, TimeSpan? timeout)
Parameters
|
System.Data.DataTable
table
The DataTable for import. |
|
Worksheet
worksheet
The Worksheet where the data should be added. |
|
System.Nullable<System.TimeSpan>
timeout
The timeout after which the operation will be cancelled. |
Exceptions
|
System.ArgumentOutOfRangeException
The exception that is thrown when timeout is less than -1 or greater than Int32.MaxValue. Note that this upper bound is more restrictive than TimeSpan.MaxValue. |