Page Setup | Headers and Footers

Is there any way to manipulate the Page Setup of an Excel Sheet.

Specifically, I am looking to set the header/footer information and the following...

Sheet:print-area
Sheet:rows-to-repeat-at-top
Sheet:cols-to-repeat-at-left
Sheet:print-grid-lines




5 Replies

YG Yavanaarasi G Syncfusion Team June 24, 2008 08:59 AM UTC

Hi JimB,

Thank you for your interest in Syncfusion products.

Yes. You can set the header/footer by using the below code snippet:


// Setting the Page number in the Center Header
sheet.PageSetup.CenterHeader = "&P";

// Setting the Time in the Left Header
sheet.PageSetup.LeftHeader = "&T";

// Setting the Date in the Right Header
sheet.PageSetup.RightHeader = "&D";

// Setting the file name in the Center Footer
sheet.PageSetup.CenterFooter = "&F";

// Setting the Shee Name in the Left Footer
sheet.PageSetup.LeftFooter = "&A";

// Setting the Location of the File in the Right Footer
sheet.PageSetup.RightFooter = "&Z";


Here is the KB article for how to set header and footer:



Please let me know if you have any other concerns.

Regards,
G.Yavana




JB Jim Barry June 24, 2008 01:52 PM UTC

Using XP SP3, Office/Excel 2003.

If I setup a page footer, the footer displays "Page]" and not the page number as expected...

setup.CenterFooter = "&[Page]"

If I manually audit the "&[Page]" value, it seems to make a differences and starts working as expeced.



JB Jim Barry June 24, 2008 07:48 PM UTC

OK, got it.

I need to use the special VB codes (&P) vs. the Excel syntax (&[Page])



YG Yavanaarasi G Syncfusion Team June 25, 2008 12:17 PM UTC

Hi JimB,

Thank you for your update.

Please let me know if you have any other concerns.

Regards,
G.Yavana


Loader.
Up arrow icon