Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

OfficeTableFormat

OfficeIMO.Data

Namespace
OfficeIMO.Data
Assembly
OfficeIMO.Core
Source revision
c5330b144ca8 with working tree changes
Modifiers
abstract

Reads and writes the tables of a multi-table file format, such as a workbook, as data readers. Structured-data conversion takes providers through its options, so a format is available only where its package is referenced.

Inheritance

  • object
  • OfficeTableFormat

Remarks

Formats are named by their usual file extension without the dot, in lower case: xlsx, xlsb, xls, ods. Input streams passed to a provider can seek, and providers leave every stream open.

Methods

public virtual IReadOnlyList<OfficeDiagnostic>? Convert(Stream input, string source, Stream output, string target, CancellationToken cancellationToken) #

Converts a whole file between two formats of this provider, keeping what both formats hold beyond cell values. Returns the findings, or null when this provider does not convert that pair; the conversion then copies cell values table by table.

Parameters

input System.IO.Stream required
source string required
output System.IO.Stream required
target string required
cancellationToken System.Threading.CancellationToken required

Returns

IReadOnlyList<OfficeDiagnostic>?
public abstract DbDataReader OpenReader(Stream input, string format, OfficeTableReadRequest request, CancellationToken cancellationToken) #

Opens the rows of one table, or of every table as successive results when OfficeTableReadRequest.Table is null.

Parameters

input System.IO.Stream required
format string required
request OfficeIMO.Data.OfficeTableReadRequest required
cancellationToken System.Threading.CancellationToken required

Returns

DbDataReader
public abstract IReadOnlyList<string> ReadTableNames(Stream input, string format, CancellationToken cancellationToken) #

Gets the names of the tables in input, in order, and leaves its position unchanged.

Parameters

input System.IO.Stream required
format string required
cancellationToken System.Threading.CancellationToken required

Returns

IReadOnlyList<string>
public abstract IReadOnlyList<OfficeDiagnostic> Write(Stream output, string format, IEnumerable<OfficeTable> tables, CancellationToken cancellationToken) #

Writes each table in turn and returns what the format could not hold.

Parameters

output System.IO.Stream required
Receives the file.
format string required
The format to write.
tables System.Collections.Generic.IEnumerable<OfficeIMO.Data.OfficeTable> required
The tables to write. Each table's rows can be read only until the next table is taken.
cancellationToken System.Threading.CancellationToken required
Cancels writing.

Returns

IReadOnlyList<OfficeDiagnostic>

Properties

public abstract IReadOnlyList<string> Formats { get; } #

Gets the formats this provider reads and writes.