Page 1 of 1

Excel - Page Numbering

Posted: Wed Nov 10, 2010 9:41 am
by PAWJade
Hello,

I have written an excel report using Jade.
The only thing I have not been able to do is get the page numbering to work.
Excel expects: Page &[Page] of &[Pages] in footer or header.

I know I can set the excel footer with:
sheet.pageSetup.rightFooter := 'Junk';

My snippet of code that works except for footer:
vars
sheet: I_Worksheet;
begin
sheet := createXLSSheet(accountType, accountHdr & accountNo & ' - ' & billDateHeader, excelHeaderArray);
sheet.range('L2', 'O2').putHorizontalAlignment(4);
sheet.pageSetup.orientation := 2; //Landscape
sheet.pageSetup.centerHeader := accountHdr & accountNo & ' - ' & billDateHeader;
sheet.pageSetup.rightFooter := 'Page &[Page] of &[Pages]';
end;


PAW

Re: Excel - Page Numbering

Posted: Wed Nov 10, 2010 9:51 am
by BeeJay
Try using the following code instead:

sheet.pageSetup.rightFooter := 'Page &P of &N';

Does that help produce the desired result?

Cheers,
BeeJay.

Re: Excel - Page Numbering

Posted: Wed Nov 10, 2010 10:09 am
by BeeJay
You may also want to refer to the following page for a list of other & escape sequences for programmatic setting of header & footer values:

http://msdn.microsoft.com/en-us/library ... e.12).aspx

Cheers,
BeeJay.

Re: Excel - Page Numbering

Posted: Wed Nov 10, 2010 10:16 am
by PAWJade
BeeJay!

Thx mate!

That did the trick.

We will just let the user discover that it works next time they run as a nice surprise.

Thx again!

PAW