CF_XLS_Style
Description
Creates a new global style. This global
style can then be applied to cells by using the cell's
StyleID attribute. This allows the developer to create
style once through the CF_XLS_Style tag and then use the
style repeatedly within the workbook. This tag can only be
used within the
CF_XLS_Workbook tag.
Syntax
<CF_XLS_Style
Align = "left|center|right"
BackgroundColor = "Color" (see below)
Border = "Border" (see below)
BorderColor = "Color" (see below)
BottomBorder = "Border" (see below)
BottomBorderColor = "Color" (see below)
DataFormat = "Data Format" (see below)
FontID = "ReferenceID"
ID = "ReferenceID"
LeftBorder = "Border" (see below)
LeftBorderColor = "Color" (see below)
RightBorder = "Border" (see below)
RightBorderColor = "Color" (see below)
TopBorder = "Border" (see below)
TopBorderColor = "Color" (see below)
VerticalAlign = "top|center|bottom"
WrapText = "yes" or "no"/>
Attributes
| Attribute |
Req/Opt |
Default |
Description |
| Align |
Opt |
left |
The horizontal alignment of the
text. |
| BackgroundColor |
Opt |
|
One of the defined colors. (See
Colors below) |
| Border |
Opt |
|
A type of border for the entire cell,
top, right, left and bottom borders. (See Borders
below) |
| BorderColor |
Opt |
black |
A color for all of the borders, top,
right, left and bottom border. (See Colors below) |
| BottomBorder |
Opt |
|
A type of border for just the bottom
border. (See Borders below) |
| BottomBorderColor |
Opt |
black |
A color for just the bottom border.
(See Colors below) |
| DataFormat |
Opt |
General |
A string represented how the cell's value is
displayed. Below are examples.
- General
- 0
- 0.00
- #,##0
- #,##0.00
- ($#,##0_);($#,##0)
- ($#,##0_);[Red]($#,##0)
- ($#,##0.00);($#,##0.00)
- ($#,##0.00_);[Red]($#,##0.00)
- 0%
- 0.00%
- 0.00E+00
- # ?/?
- # ??/??
- m/d/yy
- d-mmm-yy
- d-mmm
- mmm-yy
- h:mm AM/PM
- h:mm:ss AM/PM
- h:mm
- h:mm:ss
- m/d/yy h:mm
|
| FontID |
Opt |
|
The name of a global font defined
with the CF_XLS_Font
tag. |
| ID |
Opt |
|
A string/name for the current cell.
The name can then be referenced later in formulas,
merged cells, print areas, freezed cells and repeating
rows. |
| LeftBorder |
Opt |
|
A type of border for just the left
border. (See Borders below) |
| LeftBorderColor |
Opt |
black |
A color for just the left border.
(See Colors below) |
| RightBorder |
Opt |
|
A type of border for just the right
border. (See Borders below) |
| RightBorderColor |
Opt |
black |
A color for just the right border.
(See Colors below) |
| TopBorder |
Opt |
|
A type of border for just the top
border. (See Borders below) |
| TopBorderColor |
Opt |
black |
A color for just the top border. (See
Colors below) |
| VerticalAlign |
Opt |
left |
The type of data that is contained in the cell.
|
| WrapText |
Opt |
No |
Text wrapped to the cells width. The height of the
row may need to be specifed for desired results.
- Yes - the text will be wrapped to stay within
the bounds of the cell's width.
- No - the text will not be wrapped and may spill
into the next cell.
|
Usage
Borders:
- None
- DASH_DOT
- DASH_DOT_DOT
- DASHED
- DASH_DOT_DOT
- DASH_DOT_DOT
- DASH_DOT_DOT
- MEDIUM
- MEDIUM_DASH_DOT
- MEDIUM_DASH_DOT_DOT
- MEDIUM_DASHED
- SLANTED_DASH_DOT
- THICK
- THIN
Colors:
- GRAY
- BLACK
- BLUE
- BLUE_GREY
- BRIGHT_GREEN
- BROWN
- CORAL
- CORNFLOWER_BLUE
- DARK_BLUE
- DARK_GREEN
- DARK_RED
- DARK_TEAL
- DARK_YELLOW
- GOLD
- GREEN
- GREY_25_PERCENT
- GREY_40_PERCENT
- GREY_50_PERCENT
- GREY_80_PERCENT
- INDIGO
- LAVENDER
- LEMON_CHIFFON
- LIGHT_BLUE
- LIGHT_CORNFLOWER_BLUE
- LIGHT_GREEN
- LIGHT_ORANGE
- LIGHT_TURQUOISE
- LIGHT_YELLOW
- LIME
- MAROON
- OLIVE_GREEN
- ORANGE
- ORCHID
- PALE_BLUE
- PINK
- PLUM
- RED
- ROSE
- ROYAL_BLUE
- SEA_GREEN
- SKY_BLUE
- TAN
- TEAL
- TURQUOISE
- VIOLET
- WHITE
- YELLOW
Example
See the examples
page.