Show / Hide Table of Contents

Class ExcelHeaderFooterTextCollection

The collection of ExcelHeaderFooterTextItems.

Inheritance
object
ExcelHeaderFooterTextCollection
Implements
IEnumerable<ExcelHeaderFooterTextItem>
IEnumerable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: OfficeOpenXml.Style.HeaderFooterTextFormat
Assembly: EPPlus.dll
Syntax
public class ExcelHeaderFooterTextCollection : IEnumerable<ExcelHeaderFooterTextItem>, IEnumerable

Properties

Count

The number of objects in the collection.

Declaration
public int Count { get; }
Property Value
Type Description
int

this[int]

Returns the ExcelHeaderFooterTextItem at index

Declaration
public ExcelHeaderFooterTextItem this[int index] { get; set; }
Parameters
Type Name Description
int index

the index of item to return.

Property Value
Type Description
ExcelHeaderFooterTextItem

Picture

The drawing vml reference to inserted picture.

Declaration
public ExcelVmlDrawingPicture Picture { get; set; }
Property Value
Type Description
ExcelVmlDrawingPicture

Text

Get the raw text of the collection.

Declaration
public string Text { get; set; }
Property Value
Type Description
string

TextLength

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

Declaration
public int TextLength { get; }
Property Value
Type Description
int

Methods

Add(ExcelHeaderFooterTextItem)

Add an ExcelHeaderFooterTextItem to the end of the collection.

Declaration
public void Add(ExcelHeaderFooterTextItem textItem)
Parameters
Type Name Description
ExcelHeaderFooterTextItem textItem

AddCurrentDate()

Add the current date to the end of the collection.

Declaration
public ExcelHeaderFooterTextItem AddCurrentDate()
Returns
Type Description
ExcelHeaderFooterTextItem

AddCurrentTime()

Add the current time to the end of the collection.

Declaration
public ExcelHeaderFooterTextItem AddCurrentTime()
Returns
Type Description
ExcelHeaderFooterTextItem

AddFileName()

Add the file name to the end of the collection.

Declaration
public ExcelHeaderFooterTextItem AddFileName()
Returns
Type Description
ExcelHeaderFooterTextItem

AddFilePath()

Add the file path to the end of the collection.

Declaration
public ExcelHeaderFooterTextItem AddFilePath()
Returns
Type Description
ExcelHeaderFooterTextItem

AddImage(FileInfo)

Add a picture to the end of the collection.

Declaration
public ExcelHeaderFooterTextItem AddImage(FileInfo pictureFile)
Parameters
Type Name Description
FileInfo pictureFile

The FileInfo object for the picture.

Returns
Type Description
ExcelHeaderFooterTextItem

AddImage(Stream, ePictureType)

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

Declaration
public ExcelHeaderFooterTextItem AddImage(Stream pictureStream, ePictureType pictureType)
Parameters
Type Name Description
Stream pictureStream

The picture stream.

ePictureType pictureType

The file type of the picture.

Returns
Type Description
ExcelHeaderFooterTextItem

AddNumberOfPages()

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

Declaration
public ExcelHeaderFooterTextItem AddNumberOfPages()
Returns
Type Description
ExcelHeaderFooterTextItem

AddPageNumber(int)

Add the page number to the end of the collection.

Declaration
public ExcelHeaderFooterTextItem AddPageNumber(int number = 0)
Parameters
Type Name Description
int number

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

Returns
Type Description
ExcelHeaderFooterTextItem

AddSheetName()

Add the sheet name to the end of the collection.

Declaration
public ExcelHeaderFooterTextItem AddSheetName()
Returns
Type Description
ExcelHeaderFooterTextItem

AddText(string)

Add a string to the end of the collection.

Declaration
public ExcelHeaderFooterTextItem AddText(string text)
Parameters
Type Name Description
string text
Returns
Type Description
ExcelHeaderFooterTextItem

Clear()

Clear the collection.

Declaration
public void Clear()

Insert(int, ExcelHeaderFooterTextItem)

Insert an ExcelHeaderFooterTextItem at specified position in the collection.

Declaration
public void Insert(int index, ExcelHeaderFooterTextItem item)
Parameters
Type Name Description
int index
ExcelHeaderFooterTextItem item
Exceptions
Type Condition
IndexOutOfRangeException
ArgumentException

InsertCurrentDate(int)

Insert the current date at specified position in the collection.

Declaration
public ExcelHeaderFooterTextItem InsertCurrentDate(int index)
Parameters
Type Name Description
int index
Returns
Type Description
ExcelHeaderFooterTextItem

InsertCurrentTime(int)

Insert the current time at specified position in the collection.

Declaration
public ExcelHeaderFooterTextItem InsertCurrentTime(int index)
Parameters
Type Name Description
int index
Returns
Type Description
ExcelHeaderFooterTextItem

InsertFileName(int)

Insert the file name at specified position in the collection.

Declaration
public ExcelHeaderFooterTextItem InsertFileName(int index)
Parameters
Type Name Description
int index
Returns
Type Description
ExcelHeaderFooterTextItem

InsertFilePath(int)

Insert the file path at specified position in the collection.

Declaration
public ExcelHeaderFooterTextItem InsertFilePath(int index)
Parameters
Type Name Description
int index
Returns
Type Description
ExcelHeaderFooterTextItem

InsertImage(int, FileInfo)

Insert a picture at specified position in the collection.

Declaration
public ExcelHeaderFooterTextItem InsertImage(int index, FileInfo pictureFile)
Parameters
Type Name Description
int index
FileInfo pictureFile
Returns
Type Description
ExcelHeaderFooterTextItem

InsertImage(int, Stream, ePictureType)

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

Declaration
public ExcelHeaderFooterTextItem InsertImage(int index, Stream pictureStream, ePictureType pictureType)
Parameters
Type Name Description
int index
Stream pictureStream
ePictureType pictureType
Returns
Type Description
ExcelHeaderFooterTextItem

InsertNumberOfPages(int)

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

Declaration
public ExcelHeaderFooterTextItem InsertNumberOfPages(int index)
Parameters
Type Name Description
int index
Returns
Type Description
ExcelHeaderFooterTextItem

InsertPageNumber(int, int)

Insert the page number at specified position in the collection.

Declaration
public ExcelHeaderFooterTextItem InsertPageNumber(int index, int number = 0)
Parameters
Type Name Description
int index
int number
Returns
Type Description
ExcelHeaderFooterTextItem

InsertSheetName(int)

Insert the sheet name at specified position in the collection.

Declaration
public ExcelHeaderFooterTextItem InsertSheetName(int index)
Parameters
Type Name Description
int index
Returns
Type Description
ExcelHeaderFooterTextItem

InsertText(int, string)

Insert a string at specified position in the collection.

Declaration
public ExcelHeaderFooterTextItem InsertText(int index, string text)
Parameters
Type Name Description
int index
string text
Returns
Type Description
ExcelHeaderFooterTextItem
Exceptions
Type Condition
IndexOutOfRangeException
ArgumentException

Remove(ExcelHeaderFooterTextItem)

Remove the specified item from the collection.

Declaration
public void Remove(ExcelHeaderFooterTextItem item)
Parameters
Type Name Description
ExcelHeaderFooterTextItem item

RemoveAt(int)

Remove the specified item at index in collection.

Declaration
public void RemoveAt(int index)
Parameters
Type Name Description
int index

RemovePicture()

Remove the picture from the header or footer.

Declaration
public void RemovePicture()

Implements

IEnumerable<T>
IEnumerable
In this article
Back to top Generated by DocFX