IWorksheetExporter
Streams rows, columns, merged ranges, and view/page settings for a single worksheet.
Definition
Namespace:Telerik.Documents.SpreadsheetStreaming
Assembly:Telerik.Documents.SpreadsheetStreaming.dll
Syntax:
public interface IWorksheetExporter : IDisposable
Inherited Members
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.
void BeginFiltering(SpreadAutoFilter autoFilter)
The auto-filter model containing range and filter column definitions.
Exceptions: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.
Thrown when autoFilter is null.
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:
- SpreadTop10Filter and SpreadDynamicFilter with AboveAverage or BelowAverage emit rules but do not hide rows (all rows remain visible).
- Formula cells without a cached value (single-arg SetFormula(string)) are always visible.
- String-typed cells containing date-formatted text are NOT auto-parsed as dates. Pass DateTime via SetValue(DateTime) for date filters.
Create a column exporter for defining column widths and grouping before writing rows.
Create a page setup exporter to configure print layout settings for the sheet.
IPageSetupExporter CreatePageSetupExporter()
The page setup exporter.
Create a row exporter positioned at the next row for writing cells.
Create a view exporter to configure viewport state (freeze panes, zoom, selection, visibility).
IWorksheetViewExporter CreateWorksheetViewExporter()
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.
void EndFiltering()
Thrown when BeginFiltering(SpreadAutoFilter) was not called before this method, or when EndFiltering() has already been called.
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.
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.
void SetAutoFilter(int fromRowIndex, int fromColumnIndex, int toRowIndex, int toColumnIndex)
The start row index of the auto-filter range.
fromColumnIndexintThe start column index of the auto-filter range.
toRowIndexintThe end row index of the auto-filter range.
toColumnIndexintThe end column index of the auto-filter range.
Exceptions: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.
void SetAutoFilter(SpreadAutoFilter autoFilter)
The auto-filter model containing range and optional filter column definitions.
Exceptions:Thrown when an auto-filter has already been set on this worksheet or when BeginFiltering(SpreadAutoFilter) is currently active.
Thrown when autoFilter is null.
Advance the internal column position by a given number without writing cells.
Advance the internal row index by the specified number without emitting row elements.