ExcelSheetFluent
OfficeIMO.Excel
The fluent methods of ExcelSheet, generated from its public properties: A property-named method sets a property and a singular-named method adds to a collection, both returning the same instance.
Inheritance
- object
- ExcelSheetFluent
Methods
public static TSelf ColumnWidths<TSelf>(TSelf excelSheet, IReadOnlyDictionary<int, ExcelColumnWidth> columnWidths) #Applies positive custom widths together and saves the worksheet XML once. Existing column styles, visibility and outline metadata are preserved.
Type Parameters
- TSelf
Parameters
- excelSheet TSelf
- The instance.
- columnWidths System.Collections.Generic.IReadOnlyDictionary<int, OfficeIMO.Excel.ExcelColumnWidth>
- Widths keyed by 1-based column index. Widths above 255 are clamped.
Returns
TSelf The same instance.public static TSelf DefaultColumnWidth<TSelf>(TSelf excelSheet, ExcelColumnWidth width, bool save = true) #Sets the worksheet default column width from characters or a physical length.
Type Parameters
- TSelf
Parameters
- excelSheet TSelf
- The instance.
- width OfficeIMO.Excel.ExcelColumnWidth
- Default column width. Excel supports resolved widths up to 255 character units.
- save bool = true
- Whether to save the worksheet XML immediately.
Returns
TSelf The same instance.public static TSelf DefaultRowHeight<TSelf>(TSelf excelSheet, ExcelColumnWidth height, bool hidden = false, bool save = true) #Sets the worksheet default row height from characters or a physical length.
Type Parameters
- TSelf
Parameters
- excelSheet TSelf
- The instance.
- height OfficeIMO.Excel.ExcelColumnWidth
- Default row height. Excel supports physical heights up to 409 points.
- hidden bool = false
- Whether empty rows should be hidden by default.
- save bool = true
- Whether to save the worksheet XML immediately.
Returns
TSelf The same instance.public static TSelf Document<TSelf>(TSelf excelSheet, Action<ExcelDocument> configure) #Configures ExcelSheet.Document in place: Gets the workbook that owns this worksheet.
Type Parameters
- TSelf
Parameters
- excelSheet TSelf
- The instance.
- configure System.Action<OfficeIMO.Excel.ExcelDocument>
- Configures the value.
Returns
TSelf The same instance.public static TSelf ExecutionOverride<TSelf>(TSelf excelSheet, ExcelExecutionPolicy? value) #Sets ExcelSheet.ExecutionOverride: Override execution policy for this sheet. Null = inherit from document.
Type Parameters
- TSelf
Parameters
- excelSheet TSelf
- The instance.
- value OfficeIMO.Excel.ExcelExecutionPolicy?
- The value.
Returns
TSelf The same instance.Examples
// C# initializer or property // C# fluent
excelSheet.ExecutionOverride = value; excelSheet.ExecutionOverride(value);public static TSelf ExecutionOverride<TSelf>(TSelf excelSheet, Action<ExcelExecutionPolicy> configure) #Configures ExcelSheet.ExecutionOverride in place (creating it when not set): Override execution policy for this sheet. Null = inherit from document.
Type Parameters
- TSelf
Parameters
- excelSheet TSelf
- The instance.
- configure System.Action<OfficeIMO.Excel.ExcelExecutionPolicy>
- Configures the value.
Returns
TSelf The same instance.public static TSelf Name<TSelf>(TSelf excelSheet, string value) #Sets ExcelSheet.Name: Gets or sets the worksheet name.
Type Parameters
- TSelf
Parameters
- excelSheet TSelf
- The instance.
- value string
- The value.
Returns
TSelf The same instance.Examples
// C# initializer or property // C# fluent
excelSheet.Name = value; excelSheet.Name(value);public static TSelf OutlineSummary<TSelf>(TSelf excelSheet, bool? summaryBelow = null, bool? summaryRight = null) #Configures the worksheet outline summary positions shown by Excel.
Type Parameters
- TSelf
Parameters
- excelSheet TSelf
- The instance.
- summaryBelow bool? = null
- Whether row summaries should appear below grouped rows.
- summaryRight bool? = null
- Whether column summaries should appear to the right of grouped columns.
Returns
TSelf The same instance.public static TSelf PageSetup<TSelf>(TSelf excelSheet, Action<ExcelSheetPageSetup> configure) #Configures ExcelSheet.PageSetup in place: Paper, orientation, scaling, margins, print area and titles, print options, headers and footers.
Type Parameters
- TSelf
Parameters
- excelSheet TSelf
- The instance.
- configure System.Action<OfficeIMO.Excel.ExcelSheetPageSetup>
- Configures the value.
Returns
TSelf The same instance.public static TSelf TabColor<TSelf>(TSelf excelSheet, OfficeColor color) #Sets a literal or theme-based worksheet tab color.
Type Parameters
- TSelf
Parameters
- excelSheet TSelf
- The instance.
- color OfficeIMO.OfficeColor
- A literal RGBA color, native theme role or status color.
Returns
TSelf The same instance.public static TSelf TableStyle<TSelf>(TSelf excelSheet, string tableOrRange, ExcelTableStyle style, bool? showFirstColumn = null, bool? showLastColumn = null, bool? showRowStripes = null, bool? showColumnStripes = null) #Updates the visual style flags for the table identified by range, name, or display name.
Type Parameters
- TSelf
Parameters
- excelSheet TSelf
- The instance.
- tableOrRange string
- Table range, name, or display name.
- style OfficeIMO.Excel.ExcelTableStyle
- Table style to apply.
- showFirstColumn bool? = null
- Optional first-column emphasis flag.
- showLastColumn bool? = null
- Optional last-column emphasis flag.
- showRowStripes bool? = null
- Optional row stripe flag.
- showColumnStripes bool? = null
- Optional column stripe flag.
Returns
TSelf The same instance.public static TSelf View<TSelf>(TSelf excelSheet, Action<ExcelSheetView> configure) #Configures ExcelSheet.View in place: Frozen panes, gridlines, zero values, headings, direction, zoom and view mode.
Type Parameters
- TSelf
Parameters
- excelSheet TSelf
- The instance.
- configure System.Action<OfficeIMO.Excel.ExcelSheetView>
- Configures the value.
Returns
TSelf The same instance.