PageSetup.SetFooter

PageSetup.SetFooter method

Sets a script formatting the footer of an Excel file.

public void SetFooter(int section, string footerScript)
ParameterTypeDescription
sectionInt320: Left Section, 1: Center Section, 2: Right Section.
footerScriptStringFooter format script.

Remarks

Script commands:

CommandDescription
&PCurrent page number
&NPage count
&DCurrent date
&TCurrent time
&ASheet name
&FFile name without path
&"<FontName>"Font name, for example: &“Arial”
&"<FontName>, <FontStyle>"Font name and font style, for example: &“Arial,Bold”
&<FontSize>Font size. If this command is followed by a plain number to be printed in the header, it will be separated from the font height with a space character.
&K<RRGGBB>Font color, for example(RED): &KFF0000
&GImage script

For example: “&Arial,Bold&8Footer Note”

Examples

using System;
using Aspose.Cells;

namespace AsposeCellsExamples
{
    public class PageSetupMethodSetFooterWithInt32StringDemo
    {
        public static void Run()
        {
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];
            
            worksheet.PageSetup.SetFooter(0, "Page &P");
            worksheet.PageSetup.SetFooter(1, "&D");
            worksheet.PageSetup.SetFooter(2, "&A");
            
            workbook.Save("output.xlsx");
        }
    }
}

See Also