Apply Footer to all sheets


#1

I’m doing a proof of concept. I’m trying to apply a footer to every sheet. The example shows a single sheet. I could probably loop through each sheet and set a footer. Is there another way?


#2

@RCAtWork,

Thanks for your query.

Well, in MS Excel, headers and footers are applied based on sheets. So, your understanding is correct. You may loop through sheets to set your desired footer for them.

Let us know if we can be of any further help, we will be happy to assist you soon.


#3

Thanks Amjad, I resolved this.

foreach (var item in workbook.Worksheets)
{
	Aspose.Cells.PageSetup pageSetup = item.PageSetup;
	pageSetup.SetFooter(0, "");
	pageSetup.SetFooter(1, $"&\"Tahoma\"&8FooterText");
	pageSetup.SetFooter(2, "");
}

#4

@RCAtWork,

Good to know that you have sorted it out now. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.