Message-ID: <2093712499.9353.1711689317452.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_9352_1489704175.1711689317452" ------=_Part_9352_1489704175.1711689317452 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html GlobalStyle

GlobalStyle

Description

=20

ExcelWriter creates three style types: GlobalStyle, NamedStyle, = and CellStyle. All three style type= s derive from the Style class, and NamedStyle derives from GlobalStyle.

=20
C#
=20
<p> public class GlobalStyle : Style</p>
=20
=20
vb.net
=20
<p>Public Class GlobalStyle<br />
=09=09Inherits Style</p>
=20
=20

Remarks

=20

A style can be set or= applied to cells, rows,= columns, ranges, and areas. When a style is set, it is cloned and the object to which the style is= assigned acquires all of that style's properties, including font propertie= s and number formatting. When a style is applied, only the differences between the new style and ex= isting style properties (assigned through the ExcelWriter API or in Microso= ft Excel) will take effect. For example, if the cell has a background color= and the new style applied does not contain a background color, the cell's = color will not be affected. However, if the new style includes a background= color, it will replace the existing background color of the cell.

=20

To set a style, use t= he Style property. To apply a style, call ApplyStyle. Both are accessible= through the following objects: Cell, Area, Range, RowProperties, and ColumnProperties.

= =20

Examples

=20
C#
=20

          Style styleMoneyFormat =3D wb.CreateStyle();
          styleMoneyFormat.NumberFormat =3D "$#,##0";
          Style styleTitle =3D wb.CreateStyle();
          styleTitle.Font.Size =3D 14;
          styleTitle.Font.Color =3D wb.Palette.GetClosestColor(100, 100, 25=
5);
        
=20
=20
vb.net
=20

          Dim styleMoneyFormat As Style =3D wb.CreateStyle()
          styleMoneyFormat.NumberFormat =3D "$#,##0"
          Dim styleTitle As Style =3D wb.CreateStyle()
          styleTitle.Font.Size =3D 14
          styleTitle.Font.Color =3D wb.Palette.GetClosestColor(100, 100, 25=
5)
        
=20
------=_Part_9352_1489704175.1711689317452--