# OfficeTableFormat

Reads and writes the tables of a multi-table file format, such as a workbook, as data readers.

Class 

`OfficeIMO.Data`

**Namespace**

`OfficeIMO.Data`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`0ec96f8dbe73` with working tree changes

**Source**

[OfficeTableFormat.cs:38](https://github.com/EvotecIT/OfficeIMO/blob/0ec96f8dbe73d007f9ad409b3e178ff58c9280d9/Sources/OfficeIMO.Core/Data/OfficeTableFormat.cs#L38)

**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.

Filter members 

Show inherited

## Methods

`public virtual IReadOnlyList<OfficeDiagnostic>? Convert(Stream input, string source, Stream output, string target, CancellationToken cancellationToken)` [#](#method-convert-io-stream-string-io-stream-string-threading-cancellationtoken)

[OfficeTableFormat.cs:38](https://github.com/EvotecIT/OfficeIMO/blob/0ec96f8dbe73d007f9ad409b3e178ff58c9280d9/Sources/OfficeIMO.Core/Data/OfficeTableFormat.cs#L38)

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)` [#](#method-openreader-io-stream-string-officeimo-data-officetablereadrequest-threading-cancellationtoken)

Opens the rows of one table, or of every table as successive results when [OfficeTableReadRequest.Table](/api/core/officeimo-data-officetablereadrequest/) 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)` [#](#method-readtablenames-io-stream-string-threading-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)` [#](#method-write-io-stream-string-collections-generic-ienumerable-officeimo-data-officetable-threading-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>`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public abstract IReadOnlyList<string> Formats { get; }` [#](#property-formats)

Gets the formats this provider reads and writes.

<!-- PowerForge markdown artifact sha256:E4044D08435CA097B66CCE41F023C2B594D70A1648414A997A1DB3DC8C9D7CA9 -->
