C# Excel - Set starting page number (in code) for Excel plus increase total page number RRS feed

  • Question

  • Hello, I have a minor problem which again has not been resolved by googling to wit: I have a report which combines a 2 page Crystal Report with an Excel Report which could consist of many pages. I have tried the coding underneath to set the starting page as 3 (for the Excel) and therefore to increase the total number of pages shown in the Excel footer to be +2 as well. Only thing is it doesn't work! 

    // Page numbers as well for the PDF file (hopefully) - wir fügen 2 hin schon wegen Crystal:
    xlWS.PageSetup.CenterFooter = "&\"Calibri\" &8 Seite &P+2 von &N+2"; //"&P/&N";  // Seite fangt an mit 3 für die Excel
    So instead of the Excel pages (part of the report) starting off with 3 of 4 in a 4 page report (Crystal has 2 pages and Excel has also 2 pages) I am getting "page 3 of 22" as it is obviously just adding the 2 as a string to the "2" of the "N" in the code above. How can I increase the "N" (total pages) amount above? In other words what is the magic piece of (what must be quite simple) code to change the above, please.  

    • Edited by Sansevieria Friday, June 19, 2015 2:01 PM
    • Moved by CoolDadTx Friday, June 19, 2015 4:20 PM Office related
    Friday, June 19, 2015 1:59 PM


All replies