New to Telerik Document ProcessingStart a free 30-day trial

A workbook format provider that exports spreadsheet content to a structured JSON representation. This provider is export-only; importing JSON back into a workbook is not supported.

Definition

Namespace:Telerik.Windows.Documents.Spreadsheet.FormatProviders.Json

Assembly:Telerik.Windows.Documents.Spreadsheet.FormatProviders.Json.dll

Syntax:

C#
public class JsonFormatProvider : BinaryWorkbookFormatProviderBase, IBinaryWorkbookFormatProvider, IWorkbookFormatProvider

Inheritance: objectWorkbookFormatProviderBaseBinaryWorkbookFormatProviderBaseJsonFormatProvider

Implements: IBinaryWorkbookFormatProviderIWorkbookFormatProvider

Inherited Members BinaryWorkbookFormatProviderBase.Import(byte[], TimeSpan?)BinaryWorkbookFormatProviderBase.Export(Workbook, TimeSpan?)WorkbookFormatProviderBase.Import(Stream, TimeSpan?)WorkbookFormatProviderBase.Export(Workbook, Stream, TimeSpan?)

Constructors

Initializes a new instance of the JsonFormatProvider class with default JsonExportSettings.

C#
public JsonFormatProvider()

Methods

Performs the export operation writing a JSON representation of workbook into output.

C#
protected override void ExportOverride(Workbook workbook, Stream output, CancellationToken cancellationToken)
Parameters:workbookWorkbook

The workbook to export.

outputStream

The destination stream (must be writable).

cancellationTokenCancellationToken

Token used to observe cancellation requests.

Exceptions:

ArgumentNullException

Thrown if workbook or output is null.

Overrides: WorkbookFormatProviderBase.ExportOverride(Workbook, Stream, CancellationToken)

Import with cancellation is not supported and always throws NotSupportedException.

C#
protected override Workbook ImportOverride(Stream input, CancellationToken cancellationToken)
Parameters:inputStream

The input stream.

cancellationTokenCancellationToken

Cancellation token (ignored).

Returns:

Workbook

Never returns; always throws.

Overrides: WorkbookFormatProviderBase.ImportOverride(Stream, CancellationToken)

Properties

Gets a value indicating whether export is supported (always true).

C#
public override bool CanExport { get; }

Overrides: WorkbookFormatProviderBase.CanExport

Gets a value indicating whether import is supported (always false for this provider).

C#
public override bool CanImport { get; }

Overrides: WorkbookFormatProviderBase.CanImport

Gets or sets the export settings controlling JSON output. If null at export time, defaults are applied.

C#
public JsonExportSettings ExportSettings { get; set; }

Gets a human-readable description of the file type handled by this provider.

C#
public override string FilesDescription { get; }

Overrides: WorkbookFormatProviderBase.FilesDescription

Gets the provider name.

C#
public override string Name { get; }

Overrides: WorkbookFormatProviderBase.Name

Gets the set of supported file extensions (currently only ".json").

C#
public override IEnumerable<string> SupportedExtensions { get; }

Overrides: WorkbookFormatProviderBase.SupportedExtensions