Skip to content

Class ExcelHeaderFooterTextCollection

Namespace: OfficeOpenXml.Style.HeaderFooterTextFormat
Assembly: EPPlus.dll

The collection of ExcelHeaderFooterTextItems.

public class ExcelHeaderFooterTextCollection : IEnumerable<ExcelHeaderFooterTextItem>, IEnumerable

Inheritance

object ← ExcelHeaderFooterTextCollection

Implements

IEnumerable
IEnumerable<ExcelHeaderFooterTextItem>

Inherited Members

object.Equals(object?, object?)
object.Equals(object?)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object?, object?)
object.ToString()

Properties

Count

The number of objects in the collection.

public int Count { get; }

Property Value

int

Picture

The drawing vml reference to inserted picture.

public ExcelVmlDrawingPicture Picture { get; set; }

Property Value

ExcelVmlDrawingPicture

Text

Get the raw text of the collection.

public string Text { get; set; }

Property Value

string

TextLength

The length of the text of left, center and right header footer fields.

public int TextLength { get; }

Property Value

int

this[int]

Returns the ExcelHeaderFooterTextItem at index

public ExcelHeaderFooterTextItem this[int index] { get; set; }

Property Value

ExcelHeaderFooterTextItem

Methods

Add(ExcelHeaderFooterTextItem)

Add an ExcelHeaderFooterTextItem to the end of the collection.

public void Add(ExcelHeaderFooterTextItem textItem)

Parameters

textItem ExcelHeaderFooterTextItem

AddCurrentDate()

Add the current date to the end of the collection.

public ExcelHeaderFooterTextItem AddCurrentDate()

Returns

ExcelHeaderFooterTextItem

AddCurrentTime()

Add the current time to the end of the collection.

public ExcelHeaderFooterTextItem AddCurrentTime()

Returns

ExcelHeaderFooterTextItem

AddFileName()

Add the file name to the end of the collection.

public ExcelHeaderFooterTextItem AddFileName()

Returns

ExcelHeaderFooterTextItem

AddFilePath()

Add the file path to the end of the collection.

public ExcelHeaderFooterTextItem AddFilePath()

Returns

ExcelHeaderFooterTextItem

AddImage(FileInfo)

Add a picture to the end of the collection.

public ExcelHeaderFooterTextItem AddImage(FileInfo pictureFile)

Parameters

pictureFile FileInfo

The FileInfo object for the picture.

Returns

ExcelHeaderFooterTextItem

AddImage(Stream, ePictureType)

Add the file path to the end of the collection using a stream.

public ExcelHeaderFooterTextItem AddImage(Stream pictureStream, ePictureType pictureType)

Parameters

pictureStream Stream

The picture stream.

pictureType ePictureType

The file type of the picture.

Returns

ExcelHeaderFooterTextItem

AddNumberOfPages()

Add the number of pages to the end of the collection.

public ExcelHeaderFooterTextItem AddNumberOfPages()

Returns

ExcelHeaderFooterTextItem

AddPageNumber(int)

Add the page number to the end of the collection.

public ExcelHeaderFooterTextItem AddPageNumber(int number = 0)

Parameters

number int

Amount to offset the page number with. Default is 0.

Returns

ExcelHeaderFooterTextItem

AddSheetName()

Add the sheet name to the end of the collection.

public ExcelHeaderFooterTextItem AddSheetName()

Returns

ExcelHeaderFooterTextItem

AddText(string)

Add a string to the end of the collection.

public ExcelHeaderFooterTextItem AddText(string text)

Parameters

text string

Returns

ExcelHeaderFooterTextItem

Clear()

Clear the collection.

public void Clear()

Insert(int, ExcelHeaderFooterTextItem)

Insert an ExcelHeaderFooterTextItem at specified position in the collection.

public void Insert(int index, ExcelHeaderFooterTextItem item)

Parameters

index int

item ExcelHeaderFooterTextItem

Exceptions

IndexOutOfRangeException

ArgumentException

InsertCurrentDate(int)

Insert the current date at specified position in the collection.

public ExcelHeaderFooterTextItem InsertCurrentDate(int index)

Parameters

index int

Returns

ExcelHeaderFooterTextItem

InsertCurrentTime(int)

Insert the current time at specified position in the collection.

public ExcelHeaderFooterTextItem InsertCurrentTime(int index)

Parameters

index int

Returns

ExcelHeaderFooterTextItem

InsertFileName(int)

Insert the file name at specified position in the collection.

public ExcelHeaderFooterTextItem InsertFileName(int index)

Parameters

index int

Returns

ExcelHeaderFooterTextItem

InsertFilePath(int)

Insert the file path at specified position in the collection.

public ExcelHeaderFooterTextItem InsertFilePath(int index)

Parameters

index int

Returns

ExcelHeaderFooterTextItem

InsertImage(int, FileInfo)

Insert a picture at specified position in the collection.

public ExcelHeaderFooterTextItem InsertImage(int index, FileInfo pictureFile)

Parameters

index int

pictureFile FileInfo

Returns

ExcelHeaderFooterTextItem

InsertImage(int, Stream, ePictureType)

Insert a picture at specified position in the collection using a stream.

public ExcelHeaderFooterTextItem InsertImage(int index, Stream pictureStream, ePictureType pictureType)

Parameters

index int

pictureStream Stream

pictureType ePictureType

Returns

ExcelHeaderFooterTextItem

InsertNumberOfPages(int)

Insert the number of pages at specified position in the collection.

public ExcelHeaderFooterTextItem InsertNumberOfPages(int index)

Parameters

index int

Returns

ExcelHeaderFooterTextItem

InsertPageNumber(int, int)

Insert the page number at specified position in the collection.

public ExcelHeaderFooterTextItem InsertPageNumber(int index, int number = 0)

Parameters

index int

number int

Returns

ExcelHeaderFooterTextItem

InsertSheetName(int)

Insert the sheet name at specified position in the collection.

public ExcelHeaderFooterTextItem InsertSheetName(int index)

Parameters

index int

Returns

ExcelHeaderFooterTextItem

InsertText(int, string)

Insert a string at specified position in the collection.

public ExcelHeaderFooterTextItem InsertText(int index, string text)

Parameters

index int

text string

Returns

ExcelHeaderFooterTextItem

Exceptions

IndexOutOfRangeException

ArgumentException

Remove(ExcelHeaderFooterTextItem)

Remove the specified item from the collection.

public void Remove(ExcelHeaderFooterTextItem item)

Parameters

item ExcelHeaderFooterTextItem

RemoveAt(int)

Remove the specified item at index in collection.

public void RemoveAt(int index)

Parameters

index int

RemovePicture()

Remove the picture from the header or footer.

public void RemovePicture()