Table of Contents

Interface IRowWriter

Namespace
ExcelReader.Core.Writer
Assembly
ExcelReader.Core.dll

Writes one row's cells in column order, starting at the first column. Obtained from StartRowAsync(CancellationToken); each Write/Skip(int) call advances to the next column, so cells must be written left-to-right with no way to revisit an earlier column. Disposing the row writer (sync or async) finalizes the row and returns it to the sheet. Calling any member after disposal throws ObjectDisposedException.

public interface IRowWriter : IDisposable, IAsyncDisposable
Inherited Members

Remarks

On a null value, every nullable Write overload (including the nullable generic overload) still advances the column position by one, but whether it emits an explicit blank cell or omits a cell record entirely for that column is implementation-defined — either way, reading the cell back yields an empty/blank value.

Only ExcelReader implements this interface, and a minor version can add members to it. See versioning and compatibility.

Methods

Skip(int)

Advances past count columns without writing any cell for them, leaving them blank when the row is read back.

void Skip(int count = 1)

Parameters

count int

The number of columns to skip; must not be negative.

Write(bool)

Writes a boolean cell.

void Write(bool value)

Parameters

value bool

The value to write.

Write(DateOnly)

Writes a date-only cell (no time component).

void Write(DateOnly value)

Parameters

value DateOnly

The value to write.

Write(DateTime)

Writes a date/time cell.

void Write(DateTime value)

Parameters

value DateTime

The value to write.

Write(bool?)

Writes a boolean cell, or a blank/empty cell if value is null.

void Write(bool? value)

Parameters

value bool?

The value to write.

Write(DateOnly?)

Writes a date-only cell, or a blank/empty cell if value is null.

void Write(DateOnly? value)

Parameters

value DateOnly?

The value to write.

Write(DateTime?)

Writes a date/time cell, or a blank/empty cell if value is null.

void Write(DateTime? value)

Parameters

value DateTime?

The value to write.

Write(TimeOnly?)

Writes a time-of-day cell, or a blank/empty cell if value is null.

void Write(TimeOnly? value)

Parameters

value TimeOnly?

The value to write.

Write(string?)

Writes a text cell, or a blank/empty cell if value is null.

void Write(string? value)

Parameters

value string

The text to write.

Exceptions

ArgumentException

value exceeds Excel's per-cell text limit (32,767 characters).

Write(TimeOnly)

Writes a time-of-day cell (no date component).

void Write(TimeOnly value)

Parameters

value TimeOnly

The value to write.

WriteUtf8(ReadOnlySpan<byte>)

Writes a text cell from UTF-8 bytes, producing exactly the cell Write(string?) would for the decoded text. Writers whose output is UTF-8 copy plain text through without materializing a string; the default implementation decodes and delegates.

void WriteUtf8(ReadOnlySpan<byte> utf8)

Parameters

utf8 ReadOnlySpan<byte>

The UTF-8 encoded text to write. Invalid sequences are replaced as UTF8 decoding would.

Exceptions

ArgumentException

The decoded text exceeds Excel's per-cell text limit (32,767 characters).

Write<T>(T?)

Writes a numeric cell, or a blank/empty cell if value is null.

void Write<T>(T? value) where T : struct, IUtf8SpanFormattable

Parameters

value T?

The value to write.

Type Parameters

T

The underlying numeric value type to write.

Write<T>(T)

Writes a numeric cell for any UTF-8-formattable value type (e.g. int, double, decimal).

void Write<T>(T value) where T : IUtf8SpanFormattable

Parameters

value T

The value to write.

Type Parameters

T

The numeric value type to write.