Page tree
Skip to end of metadata
Go to start of metadata

Description

ExcelWriter has three style types: CellStyle, GlobalStyle, and NamedStyle.

C#
vb.net

Remarks

All three types derive from the Style class, and NamedStyle derives from GlobalStyle.

You cannot create a CellStyle, only manipulate existing ones as part of the objects they apply to. To create a GlobalStyle, use Workbook.CreateStyle(). To create a NamedStyle, use Workbook.CreateNamedStyle(). To get a NamedStyle from an existing document, use Workbook.GetNamedStyle().

Examples

C#
vb.net

Properties

Name

Description

BackgroundColor

Sets or returns the background color for cells.

Border

Returns a Border object for the style.

CellLocked

Sets or returns whether a cell will be locked in a protected worksheet.

Font

Sets or returns the Font object that defines the font for this style.

ForegroundColor

Sets or returns a foreground color for cells. A foreground color is visible when a pattern is assigned to a cell.

HideFormulas

Sets or returns whether formulas or their calculated results will be displayed in a protected worksheet.

HorizontalAlignment

Sets or returns the horizontal alignment of text within cells.

IndentLevel

Sets or returns level of indentation of the contents within the cell.

JustifyDistributed

Sets or returns the whether the text will be justfied horizontally, when the Horizontal Alignment is set to Distributed

NumberFormat

Sets or returns the number format string used for formatting of numbers and dates.

Orientation

Sets or returns the angle that text is displayed at, as a value between -90 and 90.

Pattern

Sets or returns a Pattern applied to cells.

ShrinkToFit

Sets or returns whether text in a cell should be reduced in size to fit within the cell's width.

TextDirection

Sets or returns the direction of the text with in the cells.

VerticalAlignment

Sets or returns the vertical alignment of text within cells.

WrapText

Sets or returns if text that is larger than the width of the cell will be wrapped, increasing the height of a cell.

Nested Classes

Name

Description

ColumnInsertBehavior

A ColumnInsertBehavior value determines what style will be applied to the inserted columns.

HAlign

The HAlign class contains all horizontal alignment options.

RowInsertBehavior

A RowInsertBehavior value determines what style will be applied to the inserted rows.

TextDir

The TextDirection class contains all text direction options.

VAlign

The VAlign class contains all vertical alignment options.
  • No labels