Table of Contents

Class ExcelHeaderFooter

Namespace
OfficeOpenXml
Assembly
EPPlus.dll

Represents the Header and Footer on an Excel Worksheet

public sealed class ExcelHeaderFooter : XmlHelper
Inheritance
ExcelHeaderFooter
Inherited Members

Fields

CurrentDate

The code for "date"

public const string CurrentDate = "&D"

Field Value

string

CurrentTime

The code for "time"

public const string CurrentTime = "&T"

Field Value

string

FileName

The code for "this workbook's file name"

public const string FileName = "&F"

Field Value

string

FilePath

The code for "this workbook's file path"

public const string FilePath = "&Z"

Field Value

string

FontColor

The code for "text font color" RGB Color is specified as RRGGBB Theme Color is specified as TTSNN where TT is the theme color Id, S is either "+" or "-" of the tint/shade value, NN is the tint/shade value.

public const string FontColor = "&K"

Field Value

string

Image

The code for "picture as background"

public const string Image = "&G"

Field Value

string

NumberOfPages

The code for "total pages"

public const string NumberOfPages = "&N"

Field Value

string

OutlineStyle

The code for "outline style"

public const string OutlineStyle = "&O"

Field Value

string

PageNumber

The code for "current page #"

public const string PageNumber = "&P"

Field Value

string

ShadowStyle

The code for "shadow style"

public const string ShadowStyle = "&H"

Field Value

string

SheetName

The code for "sheet tab name"

public const string SheetName = "&A"

Field Value

string

Properties

AlignWithMargins

Align with page margins

public bool AlignWithMargins { get; set; }

Property Value

bool

EvenFooter

Provides access to the footer on even numbered pages of the document.

public ExcelHeaderFooterText EvenFooter { get; }

Property Value

ExcelHeaderFooterText

EvenHeader

Provides access to the header on even numbered pages of the document.

public ExcelHeaderFooterText EvenHeader { get; }

Property Value

ExcelHeaderFooterText

FirstFooter

Provides access to the footer on the first page of the document.

public ExcelHeaderFooterText FirstFooter { get; }

Property Value

ExcelHeaderFooterText

FirstHeader

Provides access to the header on the first page of the document.

public ExcelHeaderFooterText FirstHeader { get; }

Property Value

ExcelHeaderFooterText

OddFooter

Provides access to the footer on odd numbered pages of the document. If you want the same footer on both odd and even pages, then only set values in this ExcelHeaderFooterText class.

public ExcelHeaderFooterText OddFooter { get; }

Property Value

ExcelHeaderFooterText

OddHeader

Provides access to the header on odd numbered pages of the document. If you want the same header on both odd and even pages, then only set values in this ExcelHeaderFooterText class.

public ExcelHeaderFooterText OddHeader { get; }

Property Value

ExcelHeaderFooterText

Pictures

Vml drawings. Underlaying object for Header footer images

public ExcelVmlDrawingPictureCollection Pictures { get; }

Property Value

ExcelVmlDrawingPictureCollection

ScaleWithDocument

The header and footer should scale as you use the ShrinkToFit property on the document

public bool ScaleWithDocument { get; set; }

Property Value

bool

differentFirst

Display different headers and footers on the first page of the worksheet.

public bool differentFirst { get; set; }

Property Value

bool

differentOddEven

Displas different headers and footers on odd and even pages.

public bool differentOddEven { get; set; }

Property Value

bool