Table of Contents

Class ExcelStyleAttribute

Namespace
ExcelReader.Core.Writer
Assembly
ExcelReader.Core.dll

Styles a property's data cells when ExcelRecordLayout writes it; the header cell is left alone. The style replaces any column or row style on those cells. Colors are 0xRRGGBB, -1 for unset.

[AttributeUsage(AttributeTargets.Property)]
public sealed class ExcelStyleAttribute : Attribute
Inheritance
ExcelStyleAttribute
Inherited Members

Properties

Bold

Gets or sets a value indicating whether the text is bold.

public bool Bold { get; set; }

Property Value

bool

Border

Gets or sets the line style of all four border edges.

public ExcelBorderStyle Border { get; set; }

Property Value

ExcelBorderStyle

BorderColor

Gets or sets the border color as 0xRRGGBB; -1 for automatic.

public int BorderColor { get; set; }

Property Value

int

FillColor

Gets or sets the solid fill color as 0xRRGGBB; -1 for no fill.

public int FillColor { get; set; }

Property Value

int

FontColor

Gets or sets the font color as 0xRRGGBB; -1 for the default color.

public int FontColor { get; set; }

Property Value

int

FontName

Gets or sets the font family name, or null for the default font.

public string? FontName { get; set; }

Property Value

string

FontSize

Gets or sets the font size in points; 0 for the default size.

public double FontSize { get; set; }

Property Value

double

HorizontalAlignment

Gets or sets the horizontal alignment.

public ExcelHorizontalAlignment HorizontalAlignment { get; set; }

Property Value

ExcelHorizontalAlignment

Indent

Gets or sets the indent level (0 to 15).

public int Indent { get; set; }

Property Value

int

Italic

Gets or sets a value indicating whether the text is italic.

public bool Italic { get; set; }

Property Value

bool

NumberFormat

Gets or sets the number-format code, or null for the general format.

public string? NumberFormat { get; set; }

Property Value

string

Rotation

Gets or sets the text rotation; see Rotation.

public int Rotation { get; set; }

Property Value

int

Strikethrough

Gets or sets a value indicating whether the text is struck through.

public bool Strikethrough { get; set; }

Property Value

bool

Underline

Gets or sets a value indicating whether the text is underlined.

public bool Underline { get; set; }

Property Value

bool

VerticalAlignment

Gets or sets the vertical alignment.

public ExcelVerticalAlignment VerticalAlignment { get; set; }

Property Value

ExcelVerticalAlignment

WrapText

Gets or sets a value indicating whether text wraps within the cell.

public bool WrapText { get; set; }

Property Value

bool

Methods

ToCellStyle()

Converts the attribute's values to a CellStyle.

public CellStyle ToCellStyle()

Returns

CellStyle

The style.

Exceptions

ArgumentException

A value is out of range.