Excel - Page Numbering

For questions and postings not covered by the other forums
PAWJade
Posts: 2
Joined: Tue Nov 09, 2010 10:28 am

Excel - Page Numbering

Postby PAWJade » Wed Nov 10, 2010 9:41 am

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

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: Excel - Page Numbering

Postby BeeJay » Wed Nov 10, 2010 9:51 am

Try using the following code instead:

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

Does that help produce the desired result?

Cheers,
BeeJay.

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: Excel - Page Numbering

Postby BeeJay » Wed Nov 10, 2010 10:09 am

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.

PAWJade
Posts: 2
Joined: Tue Nov 09, 2010 10:28 am

Re: Excel - Page Numbering

Postby PAWJade » Wed Nov 10, 2010 10:16 am

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


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 30 guests

cron