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
Initializes a new instance of the DataTableFormatProvider class with default import and export settings.
public DataTableFormatProvider()
Methods
Exports the specified worksheet to a new DataTable, converting cell values and types according to export settings.
public DataTable Export(Worksheet worksheet, TimeSpan? timeout)
The worksheet for export.
timeoutTimeSpan?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.
Exports the specified worksheet to a new DataTable, converting cell values and types according to export settings.
Imports the specified DataTable into a new workbook, creating a worksheet with the table data.
public Workbook Import(DataTable table, TimeSpan? timeout)
The DataTable for import.
timeoutTimeSpan?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.
Imports the specified DataTable into an existing worksheet, appending data at the configured start position.
public void Import(DataTable table, Worksheet worksheet, TimeSpan? timeout)
The DataTable for import.
worksheetWorksheetThe Worksheet where the data should be added.
timeoutTimeSpan?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.
Imports the specified DataTable into an existing worksheet, appending data at the configured start position.
Imports the specified DataTable into a new workbook, creating a worksheet with the table data.
Properties
Gets or sets the settings controlling how worksheet data is exported to DataTable.
public DataTableFormatProviderExportSettings ExportSettings { get; set; }
Gets or sets the settings controlling how DataTable data is imported into worksheets.
public DataTableFormatProviderImportSettings ImportSettings { get; set; }