API Reference
SheetComposer
Simple multi-column layout for placing lightweight blocks side by side.
Inheritance
- Object
- SheetComposer
Constructors
public SheetComposer(ExcelDocument workbook, String sheetName, SheetTheme theme = null) #Creates a new sheet and prepares a composer for adding content top-to-bottom. Also creates a hidden named range at the sheet top ("top_{sheet}") for navigation.
Parameters
- workbook OfficeIMO.Excel.ExcelDocument
- Target workbook.
- sheetName System.String
- Name of the sheet to create.
- theme OfficeIMO.Excel.Fluent.SheetTheme = null
- Optional theme controlling colors and spacing.
Methods
public SheetComposer AdvanceRows(Int32 rows) #SheetComposerAdvances the composer by an exact number of rows without applying themed spacing semantics. Useful after manual cell writes where the composer did not track row changes.
Parameters
- rows System.Int32
public SheetComposer ApplyColumnSizing(String a1Range, Action<ColumnSizingOptions> configure) #SheetComposerApplies clamped widths and optional wrap based on table headers for a given A1 range. The first row of the range is treated as the header row.
Parameters
- a1Range System.String
- A1 range returned from TableFrom (e.g., "A10:F42").
- configure System.Action{OfficeIMO.Excel.Fluent.ColumnSizingOptions}
- Configure sizing options and header categories.
public SheetComposer BulletedList(IEnumerable<String> items) #SheetComposerWrites a simple bulleted list, one item per row.
Parameters
- items System.Collections.Generic.IEnumerable{System.String}
public SheetComposer BulletedListWithFill(IEnumerable<String> items, String fillHex) #SheetComposerBulleted list with background fill per item row.
Parameters
- items System.Collections.Generic.IEnumerable{System.String}
- fillHex System.String
public SheetComposer Callout(String kind, String title, String body, Int32 widthColumns = 8) #SheetComposerInserts a simple callout (admonition) band consisting of a bold title row and a body row.
Parameters
- kind System.String
- title System.String
- body System.String
- widthColumns System.Int32 = 8
public SheetComposer Columns(Int32 count, Action<ColumnComposer[]> configure, Int32 columnWidth = 3, Int32 gutter = 1, OverflowMode overflow = Throw) #SheetComposerPlaces N columns side-by-side starting at the current row. Each action receives a ColumnComposer scoped to its own column. The main composer advances to the maximum height used by the columns.
Parameters
- count System.Int32
- Number of columns (2–4 recommended).
- configure System.Action{OfficeIMO.Excel.Fluent.SheetComposer.ColumnComposer[]}
- Callback that receives an array of ColumnComposer objects.
- columnWidth System.Int32 = 3
- Width per column in grid columns (for relative positioning only).
- gutter System.Int32 = 1
- Spacing between columns in grid columns.
- overflow OfficeIMO.Excel.Fluent.OverflowMode = Throw
- Specifies how to handle content that exceeds the allocated width of a column.
public SheetComposer ColumnsAdaptive(IReadOnlyList<Action<ColumnComposer>> builders, Int32 gutter = 1) #SheetComposerPlaces columns left-to-right starting at the current row using adaptive widths derived from each column's content. Each column is rendered at the computed base column and the next column starts at (previous end + 1 + gutter).
Parameters
- builders System.Collections.Generic.IReadOnlyList{System.Action{OfficeIMO.Excel.Fluent.SheetComposer.ColumnComposer}}
- gutter System.Int32 = 1
public SheetComposer ColumnsAdaptiveRows(IReadOnlyList<IReadOnlyList<Action<ColumnComposer>>> rows, Int32 gutter = 1) #SheetComposerRenders multiple rows of adaptive columns. Each inner list is a left-to-right band; rows stack vertically.
Parameters
- rows System.Collections.Generic.IReadOnlyList{System.Collections.Generic.IReadOnlyList{System.Action{OfficeIMO.Excel.Fluent.SheetComposer.ColumnComposer}}}
- gutter System.Int32 = 1
public SheetComposer ConditionalColorScale(String rangeA1, String startHex, String endHex) #SheetComposerAdds a conditional color scale to the given range.
Parameters
- rangeA1 System.String
- startHex System.String
- endHex System.String
public SheetComposer ConditionalDataBar(String rangeA1, String colorHex) #SheetComposerAdds a conditional data bar to the given range.
Parameters
- rangeA1 System.String
- colorHex System.String
public SheetComposer ConditionalIconSet(String rangeA1, IconSetValues set, Boolean showValue = true, Boolean reverse = false, Double[] percentThresholds = null, Double[] numberThresholds = null) #SheetComposerAdds an icon set conditional formatting rule to the given range.
Parameters
- rangeA1 System.String
- set DocumentFormat.OpenXml.Spreadsheet.IconSetValues
- showValue System.Boolean = true
- reverse System.Boolean = false
- percentThresholds System.Double[] = null
- numberThresholds System.Double[] = null
public SheetComposer DefinitionList(IEnumerable<ValueTuple<String, Object>> items, Int32 columns = 2) #SheetComposerAlias for Int32).
Parameters
- items System.Collections.Generic.IEnumerable{System.ValueTuple{System.String,System.Object}}
- columns System.Int32 = 2
public SheetComposer Finish(Boolean autoFitColumns = true, Boolean autoFitRows = false) #SheetComposerApplies optional autofit operations and returns the composer.
Parameters
- autoFitColumns System.Boolean = true
- autoFitRows System.Boolean = false
public SheetComposer FlowColumns(IReadOnlyList<IReadOnlyList<Action<ColumnComposer>>> columnGroups, Int32 columnWidth = 12, Int32 gutter = 2) #SheetComposerRenders a sequence of column blocks left-to-right using a fixed number of columns per band. Each band uses [[cref:OfficeIMO.Excel.Fluent.SheetComposer.Columns(System.Int32,System.Action{OfficeIMO.Excel.Fluent.SheetComposer.ColumnComposer[]},System.Int32,System.Int32,OfficeIMO.Excel.Fluent.OverflowMode)]] under the hood and advances the composer by the tallest block in that band.
Parameters
- columnGroups System.Collections.Generic.IReadOnlyList{System.Collections.Generic.IReadOnlyList{System.Action{OfficeIMO.Excel.Fluent.SheetComposer.ColumnComposer}}}
- columnWidth System.Int32 = 12
- gutter System.Int32 = 2
public SheetComposer ImageAt(Int32 row, Int32 column, Byte[] bytes, String contentType = "image/png", Int32 widthPixels = 96, Int32 heightPixels = 32, Int32 offsetXPixels = 0, Int32 offsetYPixels = 0) #SheetComposerInserts an image anchored to a specific cell.
Parameters
- row System.Int32
- 1-based row index.
- column System.Int32
- 1-based column index.
- bytes System.Byte[]
- Image bytes.
- contentType System.String = "image/png"
- Image content type (e.g., image/png).
- widthPixels System.Int32 = 96
- Width in pixels.
- heightPixels System.Int32 = 32
- Height in pixels.
- offsetXPixels System.Int32 = 0
- Optional X offset in pixels.
- offsetYPixels System.Int32 = 0
- Optional Y offset in pixels.
public SheetComposer ImageFromUrlAt(Int32 row, Int32 column, String url, Int32 widthPixels = 96, Int32 heightPixels = 32, Int32 offsetXPixels = 0, Int32 offsetYPixels = 0) #SheetComposerDownloads an image from URL and inserts it anchored at a specific cell.
Parameters
- row System.Int32
- 1-based row index.
- column System.Int32
- 1-based column index.
- url System.String
- Direct URL to an image.
- widthPixels System.Int32 = 96
- Width in pixels.
- heightPixels System.Int32 = 32
- Height in pixels.
- offsetXPixels System.Int32 = 0
- Optional X offset in pixels.
- offsetYPixels System.Int32 = 0
- Optional Y offset in pixels.
public SheetComposer KpiRow(IEnumerable<ValueTuple<String, Object>> kpis, Int32 perRow = 3, String labelFillHex = null) #SheetComposerRenders a compact KPI row of label/value pairs.
Parameters
- kpis System.Collections.Generic.IEnumerable{System.ValueTuple{System.String,System.Object}}
- perRow System.Int32 = 3
- labelFillHex System.String = null
public SheetComposer Margins(ExcelMarginPreset preset) #SheetComposerApplies a margin preset.
Parameters
- preset OfficeIMO.Excel.ExcelMarginPreset
public SheetComposer Margins(Double left, Double right, Double top, Double bottom, Double header = 0.3, Double footer = 0.3) #SheetComposerSets explicit margins in inches.
Parameters
- left System.Double
- right System.Double
- top System.Double
- bottom System.Double
- header System.Double = 0.3
- footer System.Double = 0.3
public SheetComposer Orientation(ExcelPageOrientation orientation) #SheetComposerSets page orientation (Portrait/Landscape).
Parameters
- orientation OfficeIMO.Excel.ExcelPageOrientation
public SheetComposer Paragraph(String text, Int32 widthColumns = 6) #SheetComposerWrites a paragraph-like line of text.
Parameters
- text System.String
- widthColumns System.Int32 = 6
public SheetComposer PrintDefaults(Boolean showGridlines = false, UInt32 fitToWidth = 1, UInt32 fitToHeight = 0, String printAreaA1 = null) #SheetComposerApplies sensible print defaults: gridlines off, fit to width, and optional print area.
Parameters
- showGridlines System.Boolean = false
- fitToWidth System.UInt32 = 1
- fitToHeight System.UInt32 = 0
- printAreaA1 System.String = null
public SheetComposer PropertiesGrid(IEnumerable<ValueTuple<String, Object>> properties, Int32 columns = 2) #SheetComposerRenders a compact grid of key/value pairs.
Parameters
- properties System.Collections.Generic.IEnumerable{System.ValueTuple{System.String,System.Object}}
- columns System.Int32 = 2
public SheetComposer References(IEnumerable<String> urls) #SheetComposerWrites a simple References section with each URL as a hyperlink.
Parameters
- urls System.Collections.Generic.IEnumerable{System.String}
public SheetComposer RepeatHeaderColumns(Int32 firstCol, Int32 lastCol) #SheetComposerRepeats header columns when printing (1-based inclusive).
Parameters
- firstCol System.Int32
- lastCol System.Int32
public SheetComposer RepeatHeaderRows(Int32 firstRow, Int32 lastRow) #SheetComposerRepeats header rows when printing (1-based inclusive).
Parameters
- firstRow System.Int32
- lastRow System.Int32
public SheetComposer Score(String label, Double value, Double min = 0, Double max = 10) #SheetComposerWrites a labeled numeric score with a data bar visualization.
Parameters
- label System.String
- value System.Double
- min System.Double = 0
- max System.Double = 10
public SheetComposer Section(String text) #SheetComposerWrites a section header (bold with themed background).
Parameters
- text System.String
public SheetComposer SectionLegend(String title, IReadOnlyList<String> headers, IEnumerable<IReadOnlyList<String>> rows, IDictionary<String, String> firstColumnFillByValue = null, String headerFillHex = null) #SheetComposerRenders a compact legend block with an optional title, column headers, and rows. Optionally colors the first column using a value→color mapping.
Parameters
- title System.String
- headers System.Collections.Generic.IReadOnlyList{System.String}
- rows System.Collections.Generic.IEnumerable{System.Collections.Generic.IReadOnlyList{System.String}}
- firstColumnFillByValue System.Collections.Generic.IDictionary{System.String,System.String} = null
- headerFillHex System.String = null
public SheetComposer SectionWithAnchor(String text, String anchorName = null, Boolean backToTopLink = true, String backToTopText = "↑ Top") #SheetComposerInserts a section header and a back-to-top link (explicit A1 link).
Parameters
- text System.String
- anchorName System.String = null
- backToTopLink System.Boolean = true
- backToTopText System.String = "↑ Top"
public SheetComposer Spacer(Int32 rows = -1) #SheetComposerAdds vertical spacing by advancing the current row.
Parameters
- rows System.Int32 = -1
- Number of rows to skip; when negative uses the theme default.
public String TableFrom<T>(IEnumerable<T> items, String title = null, Action<ObjectFlattenerOptions> configure = null, TableStyle style = TableStyleMedium9, Boolean autoFilter = true, Boolean freezeHeaderRow = true, Action<TableVisualOptions> visuals = null) #StringType Parameters
- T
Parameters
- items IEnumerable<T>
- title String = null
- configure Action<ObjectFlattenerOptions> = null
- style TableStyle = TableStyleMedium9
- autoFilter Boolean = true
- freezeHeaderRow Boolean = true
- visuals Action<TableVisualOptions> = null
TableFrom``1(System.Collections.Generic.IEnumerable{``0} items, System.String title, System.Action{OfficeIMO.Excel.ObjectFlattenerOptions} configure, OfficeIMO.Excel.TableStyle style, System.Boolean autoFilter, System.Boolean freezeHeaderRow, System.Action{OfficeIMO.Excel.Fluent.TableVisualOptions} visuals) #Flattens a sequence of objects into a table and renders it with a header row. Returns the A1 range used for the table.
Parameters
- items System.Collections.Generic.IEnumerable{``0}
- title System.String
- configure System.Action{OfficeIMO.Excel.ObjectFlattenerOptions}
- style OfficeIMO.Excel.TableStyle
- autoFilter System.Boolean
- freezeHeaderRow System.Boolean
- visuals System.Action{OfficeIMO.Excel.Fluent.TableVisualOptions}
public SheetComposer Title(String text, String subtitle = null) #SheetComposerWrites a title (bold with themed background) and optional subtitle.
Parameters
- text System.String
- subtitle System.String = null
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object