ExcelColumnFormatRule
OfficeIMO.Excel
Describes one header-based column number format.
Inheritance
- object
- ExcelColumnFormatRule
Usage
Explore 3 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 3
- Property ExcelColumnFormatPlan.Rules
- Method ExcelColumnFormatRule.FromFormat
- Method ExcelColumnFormatRule.FromPreset
Methods
public static ExcelColumnFormatRule FromFormat(string header, string numberFormat, bool includeHeader = false, bool autoFit = false) #Creates a custom number-format rule.
Parameters
- header string
- numberFormat string
- includeHeader bool = false
- autoFit bool = false
Returns
ExcelColumnFormatRulepublic static ExcelColumnFormatRule FromPreset(string header, ExcelNumberPreset preset, int decimals = 2, CultureInfo? culture = null, bool includeHeader = false, bool autoFit = false) #Creates a preset-based column format rule.
Parameters
- header string
- preset OfficeIMO.Excel.ExcelNumberPreset
- decimals int = 2
- culture System.Globalization.CultureInfo? = null
- includeHeader bool = false
- autoFit bool = false
Returns
ExcelColumnFormatRulepublic string ResolveNumberFormat() #Resolves the Excel number format code for this rule.
Returns
stringInherited Methods
Properties
public string Header { get; } #Header caption used to resolve the column.
public ExcelNumberPreset? Preset { get; } #Preset number format, when the rule was created from a preset.
public string? NumberFormat { get; } #Custom number format, when supplied directly.
public int Decimals { get; } #Decimal places used by preset formats that support precision.
public CultureInfo? Culture { get; } #Culture used for culture-aware preset formats such as currency.
public bool IncludeHeader { get; } #Whether the header cell should also receive the format.
public bool AutoFit { get; } #Whether the resolved column should be auto-fit after formatting.