ClassDataTableFormatProvider
Converts between ADO.NET DataTable instances and spreadsheet workbooks, enabling bidirectional data exchange for tabular data integration.
Definition
Namespace:Telerik.Windows.Documents.Spreadsheet.FormatProviders
Assembly:Telerik.Windows.Documents.Spreadsheet.dll
Syntax:
public class DataTableFormatProvider
Inheritance: objectDataTableFormatProvider
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
ImportSettings
Gets or sets the settings controlling how DataTable data is imported into worksheets.
Declaration
public DataTableFormatProviderImportSettings ImportSettings { get; set; }
Property Value
Methods
Export(Worksheet)
Exports the specified worksheet to a new DataTable, converting cell values and types according to export settings.
Export(Worksheet, 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
The worksheet for export.
timeout
The timeout after which the operation will be cancelled.
Returns
the converted DataTable
Exceptions
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.
Import(DataTable, 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
table
The DataTable for import.
timeout
The timeout after which the operation will be cancelled.
Returns
the converted new Workbook.
Exceptions
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
[Obsolete("This method is obsolete. Please use Import(DataTable table, Worksheet worksheet, TimeSpan? timeout) instead.")]
public void Import(DataTable table, Worksheet worksheet)
Parameters
table
The DataTable for import.
worksheet
The Worksheet where the data should be added.
Import(DataTable, Worksheet, 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
table
The DataTable for import.
worksheet
The Worksheet where the data should be added.
timeout
The timeout after which the operation will be cancelled.
Exceptions
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.