.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
Row

WorksheetHeaderFooterOptions Interface

Allows you to specify headers and footers for a worksheet or chart sheet.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v20.2.Core.dll

Declaration

public interface WorksheetHeaderFooterOptions

Remarks

Use the WorksheetHeaderFooterOptions object's properties to add headers and footers to printed pages.

Properties

Description

WorksheetHeaderFooterOptions.FirstHeader,

WorksheetHeaderFooterOptions.FirstFooter

Define a header and footer for the first page.

WorksheetHeaderFooterOptions.OddHeader,

WorksheetHeaderFooterOptions.OddFooter

Define headers and footers for odd pages.

WorksheetHeaderFooterOptions.EvenHeader,

WorksheetHeaderFooterOptions.EvenFooter

Define headers and footers for even pages.

The following example shows how to specify the header and footer for the first page.

SpreadsheetControl_HeaderFooterPrintPreview

WorksheetHeaderFooterOptions options = worksheet.HeaderFooterOptions;
// Specify that the first page has a unique header and footer.
options.DifferentFirst = true;
// Insert the rich formatted text into the header's left section.
options.FirstHeader.Left = string.Format("{0}&BDev{1}AV", HeaderFooterCode.FontColor(4, -50), HeaderFooterCode.FontColor(4,10));
// Insert the sheet name into the header's right section.
options.FirstHeader.Right = "&A";
// Insert the current date into the footer's left section.
options.FirstFooter.Left = "&D";
// Insert the current page number into the footer's right section.
options.FirstFooter.Right = string.Format("Page {0} of {1}", "&P", "&N");
See Also