Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Fri Sep 04, 2015 11:14 am

How is it possible to add pagenumbers in the sheet footer, for printing

I have have tried something like this :

ws.PageSetup.RightFooter = ws.PageSetup.FirstPageNumber + "/" + ????;

i need to print "page 1/3", "Page 2/3" and so forth in the footer.

Best regards
Michael

frostholm
 
Posts: 12
Joined: Wed Sep 02, 2015 6:16 am

Mon Sep 07, 2015 3:20 am

Hello,

Sorry for late reply as weekend. You know adding headers and footers to the sheet has its own script commands, which starts with "&" character, e.g.
&P Represents current page number
&N Represents total number of pages
Here is the sample code to add pagenumber and pagenumbers in the sheet footer for your reference.
Code: Select all
mysht.PageSetup.RightFooter = "&P"+ "/" + "&N";

Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Mon Sep 07, 2015 9:20 am

thanks !!!

Is there a place where i can read about theese script commands ?

Best regards
Michael

frostholm
 
Posts: 12
Joined: Wed Sep 02, 2015 6:16 am

Mon Sep 07, 2015 9:44 am

Hello,

Sorry that at present there is no any documents about these. And we will write and publish it to our website in future.
If you have any questions, please contact us.
Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.XLS