New to Telerik UI for WinFormsStart a free 30-day trial

Streams rows, columns, merged ranges, and view/page settings for a single worksheet.

Definition

Namespace:Telerik.Documents.SpreadsheetStreaming

Assembly:Telerik.Documents.SpreadsheetStreaming.dll

Syntax:

C#
public interface IWorksheetExporter : IDisposable

Inherited Members IDisposable.Dispose()

Methods

Begin auto-filtering data rows. Rows written between this call and EndFiltering() are evaluated against the filter criteria and automatically hidden when they do not match.

C#
void BeginFiltering(SpreadAutoFilter autoFilter)
Parameters:autoFilterSpreadAutoFilter

The auto-filter model containing range and filter column definitions.

Exceptions:

InvalidOperationException

Thrown when an auto-filter has already been set, when BeginFiltering(SpreadAutoFilter) has already been called without a matching EndFiltering(), when the header row has not been written yet, or when data rows beyond the header have already been written.

ArgumentNullException

Thrown when autoFilter is null.

Remarks:

Call this method immediately after writing the header row. The header row itself is not filtered. Mutually exclusive with SetAutoFilter(SpreadAutoFilter). Rows already written before this call cannot be filtered; the internal row index must equal autoFilter.FromRowIndex + 1 at call time.

The "today" date used for dynamic date filters is captured once via Today at the time this method is called. No timezone conversion is performed. The captured date is held constant for the entire filtering block to ensure consistency even if the block spans midnight.

Streaming-mode limitations:

Create a column exporter for defining column widths and grouping before writing rows.

C#
IColumnExporter CreateColumnExporter()
Returns:

IColumnExporter

The column exporter.

Create a page setup exporter to configure print layout settings for the sheet.

C#
IPageSetupExporter CreatePageSetupExporter()
Returns:

IPageSetupExporter

The page setup exporter.

Create a row exporter positioned at the next row for writing cells.

C#
IRowExporter CreateRowExporter()
Returns:

IRowExporter

The row exporter.

Create a view exporter to configure viewport state (freeze panes, zoom, selection, visibility).

C#
IWorksheetViewExporter CreateWorksheetViewExporter()
Returns:

IWorksheetViewExporter

The worksheet view exporter.

End the active filtering block started by BeginFiltering(SpreadAutoFilter). The auto-filter range is finalized and the filter rules are emitted to the output.

C#
void EndFiltering()
Exceptions:

InvalidOperationException

Thrown when BeginFiltering(SpreadAutoFilter) was not called before this method, or when EndFiltering() has already been called.

Remarks:

Must be called after BeginFiltering(SpreadAutoFilter). Rows written after this call bypass filtering and are never hidden. Explicit EndFiltering() is required for deterministic output, but disposal of the worksheet exporter will auto-complete as a safety net.

Merge a rectangular region of cells defined by its start and end row/column indices.

C#
void MergeCells(int fromRowIndex, int fromColumnIndex, int toRowIndex, int toColumnIndex)
Parameters:fromRowIndexint

The start row index of the area.

fromColumnIndexint

The start column index of the area.

toRowIndexint

The end row index of the area.

toColumnIndexint

The end column index of the area.

Set an auto-filter on the worksheet for the specified cell range. The filter dropdown buttons will appear on the header row columns of the range. Can only be called once per worksheet and must be called after all rows have been exported.

C#
void SetAutoFilter(int fromRowIndex, int fromColumnIndex, int toRowIndex, int toColumnIndex)
Parameters:fromRowIndexint

The start row index of the auto-filter range.

fromColumnIndexint

The start column index of the auto-filter range.

toRowIndexint

The end row index of the auto-filter range.

toColumnIndexint

The end column index of the auto-filter range.

Exceptions:

InvalidOperationException

Thrown when an auto-filter has already been set on this worksheet or when BeginFiltering(SpreadAutoFilter) is currently active.

Set an auto-filter on the worksheet with a fully configured filter model including filter column definitions. Can only be called once per worksheet and must be called after all rows have been exported.

C#
void SetAutoFilter(SpreadAutoFilter autoFilter)
Parameters:autoFilterSpreadAutoFilter

The auto-filter model containing range and optional filter column definitions.

Exceptions:

InvalidOperationException

Thrown when an auto-filter has already been set on this worksheet or when BeginFiltering(SpreadAutoFilter) is currently active.

ArgumentNullException

Thrown when autoFilter is null.

Advance the internal column position by a given number without writing cells.

C#
void SkipColumns(int count)
Parameters:countint

The count of the columns to skip.

Advance the internal row index by the specified number without emitting row elements.

C#
void SkipRows(int count)
Parameters:countint

The count of the rows to skip.