OfficeIMO

API Reference

Class

SheetBuilder

Namespace OfficeIMO.Excel.Fluent
Assembly OfficeIMO.Excel

Fluent builder for composing a worksheet: headers, rows, ranges, tables, styles and filters.

Inheritance

  • Object
  • SheetBuilder

Methods

public SheetBuilder AddSheet(String name = "") #
Returns: SheetBuilder

Creates and selects a new worksheet.

Parameters

name System.String = "" optionalposition: 0
Optional sheet name.
public SheetBuilder AutoFilter(String range, Dictionary<UInt32, IEnumerable<String>> criteria = null) #
Returns: SheetBuilder

Applies AutoFilter to a range with optional per‑column criteria.

Parameters

range System.String requiredposition: 0
criteria System.Collections.Generic.Dictionary{System.UInt32,System.Collections.Generic.IEnumerable{System.String}} = null optionalposition: 1
public SheetBuilder AutoFit(Boolean columns, Boolean rows) #
Returns: SheetBuilder

Auto‑fits columns and/or rows in the current sheet.

Parameters

columns System.Boolean requiredposition: 0
rows System.Boolean requiredposition: 1
Cell 2 overloads
public SheetBuilder Cell(Int32 row, Int32 column, Object value = null, String formula = null, String numberFormat = null) #
Returns: SheetBuilder

Writes a cell at the specified row/column with optional value, formula and number format.

Parameters

row System.Int32 requiredposition: 0
column System.Int32 requiredposition: 1
value System.Object = null optionalposition: 2
formula System.String = null optionalposition: 3
numberFormat System.String = null optionalposition: 4
public SheetBuilder Cell(String reference, Object value = null, String formula = null, String numberFormat = null) #
Returns: SheetBuilder

Writes a cell using A1 reference with optional value, formula and number format.

Parameters

reference System.String requiredposition: 0
value System.Object = null optionalposition: 1
formula System.String = null optionalposition: 2
numberFormat System.String = null optionalposition: 3
public SheetBuilder Columns(Action<ColumnCollectionBuilder> action) #
Returns: SheetBuilder

Configures column widths and styles via the column collection builder.

Parameters

action System.Action{OfficeIMO.Excel.Fluent.ColumnCollectionBuilder} requiredposition: 0
public SheetBuilder ConditionalColorScale(String range, Color startColor, Color endColor) #
Returns: SheetBuilder

Adds a 2‑color scale conditional formatting rule over the range.

Parameters

range System.String requiredposition: 0
startColor SixLabors.ImageSharp.Color requiredposition: 1
endColor SixLabors.ImageSharp.Color requiredposition: 2
public SheetBuilder ConditionalDataBar(String range, Color color) #
Returns: SheetBuilder

Adds a data bar conditional formatting rule over the range.

Parameters

range System.String requiredposition: 0
color SixLabors.ImageSharp.Color requiredposition: 1
public SheetBuilder Freeze(Int32 topRows = 0, Int32 leftCols = 0) #
Returns: SheetBuilder

Freezes the specified number of rows and columns on the current sheet.

Parameters

topRows System.Int32 = 0 optionalposition: 0
Number of rows at the top to freeze.
leftCols System.Int32 = 0 optionalposition: 1
Number of columns on the left to freeze.
public SheetBuilder HeaderRow(params Object[] values) #
Returns: SheetBuilder

Adds a header row with the provided values.

Parameters

values System.Object[] requiredposition: 0
Range 2 overloads
public SheetBuilder Range(Int32 fromRow, Int32 fromCol, Int32 toRow, Int32 toCol, Object[] values = null) #
Returns: SheetBuilder

Writes a rectangular block specified by coordinates, optionally providing a 2D values array.

Parameters

fromRow System.Int32 requiredposition: 0
fromCol System.Int32 requiredposition: 1
toRow System.Int32 requiredposition: 2
toCol System.Int32 requiredposition: 3
values System.Object[0:,0:] = null optionalposition: 4
public SheetBuilder Range(String reference, Action<RangeBuilder> action) #
Returns: SheetBuilder

Configures a range using A1 notation via the range builder (styles, merges, borders, etc.).

Parameters

reference System.String requiredposition: 0
action System.Action{OfficeIMO.Excel.Fluent.RangeBuilder} requiredposition: 1
public SheetBuilder Row(Action<RowBuilder> action) #
Returns: SheetBuilder

Adds a data row configured by the supplied builder action.

Parameters

action System.Action{OfficeIMO.Excel.Fluent.RowBuilder} requiredposition: 0
public SheetBuilder RowsFrom<T>(IEnumerable<T> data, Action<ObjectFlattenerOptions> configure = null) #
Returns: SheetBuilder

Type Parameters

T

Parameters

data IEnumerable<T> requiredposition: 0
configure Action<ObjectFlattenerOptions> = null optionalposition: 1
RowsFrom``1(System.Collections.Generic.IEnumerable{``0} data, System.Action{OfficeIMO.Excel.ObjectFlattenerOptions} configure) #

Generates rows from a sequence of objects using the object flattener. Produces a header row from flattened property paths, then data rows.

Parameters

data System.Collections.Generic.IEnumerable{``0} required
configure System.Action{OfficeIMO.Excel.ObjectFlattenerOptions} required
public SheetBuilder Style(Action<StyleBuilder> action) #
Returns: SheetBuilder

Applies ad‑hoc styles via the style builder.

Parameters

action System.Action{OfficeIMO.Excel.Fluent.StyleBuilder} requiredposition: 0
Table 2 overloads
public SheetBuilder Table(String name, Action<TableBuilder> configure = null) #
Returns: SheetBuilder

Adds a table over the last added block (from RowsFrom) using the specified name.

Parameters

name System.String requiredposition: 0
configure System.Action{OfficeIMO.Excel.Fluent.TableBuilder} = null optionalposition: 1
public SheetBuilder Table(Action<TableBuilder> action) #
Returns: SheetBuilder

Adds and configures a table via the table builder.

Parameters

action System.Action{OfficeIMO.Excel.Fluent.TableBuilder} requiredposition: 0