Problem with TotalPages when printing more than one report

poppinspoppins Member Posts: 647
edited 2013-05-27 in NAV Three Tier
Hi everyone,

I am having a problem with page numbers in NAV 2013 reports.
I am using a textbox with the following expression:
="Page " & Globals!PageNumber & "/" & Globals!TotalPages

It works just fine when I print one report at a time, but when I print many reports together, it gives me something like:
Page 1/20, Page 2/20, Page 3/20, etc...as if it was only one document...
How can I fix that???

Thanks in advance :)

Comments

  • clauslclausl Member Posts: 455
    There is no fix for this in NAV 2013. So if you customer requires this, you run away.

    I outline this in this blog: http://mibuso.com/blogs/clausl/2012/08/08/rdl-vs-rdlc-versions-and-dynamics-nav

    You can try to do it like this http://msdn.microsoft.com/en-us/library/dd338694, but note that there is a reason why none of the standard document reports has Page x of z implemented.
    It is impossible to do!!! I have several time said that I will give a nice dinner to the person that solves this in NAV 2013. To this day nobody have come with a solution.

    We need RDLC 2010 and Visual Studio 2012 to be able reset PageNumber, as explained by Robert Bruckner here: http://blogs.msdn.com/b/robertbruckner/archive/2010/04/25/report-design-reset-page-number-on-group.aspx Reseting PageNumber is not a feature in RDLC 2008 and VS 2010 which is the supported designer in NAV 2013.

    So if possible try to avoid this requirement, before it is actual supported by the platform. Hopefully in a future version of NAV we will get support for RDLC 2010 and VS 2012.

    /Claus
    Claus Lundstrøm | MVP | Senior Product Manager | Continia.com
    I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
    I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
  • lyngelynge Member Posts: 85
    A NAV developer wanna-bee is brainstorming. Bear with me :-)

    In the book Microsoft Dynamics NAV 2009 Programming Cookbook, page 133, Matt Traxinger first prints the report to PDF and then parses the PDF to get the last page number. He parses it with an automation he creates in Visual Studio.
    He then makes the real output using that information to create a "Page X of Y" line.

    I think this approach is kind of a mess, but I guess it might be possible to do the same in NAV 2013? (would need dot.net insted of automation to parse it on the server)

    1. For each invoice (or whatever you are printing), call the report again filtered on the current document and save it as a temp. PDF. Parse the PDF to get the last page number.
    2. Now do the real print out, include the found last page number in the dataset for Visual Studio.

    As mentioned - I'm a wanna-bee - but would this approch be possible?
    (if we forget it is a mess :-) ).

    Regards,
    Gert Lynge
  • clauslclausl Member Posts: 455
    Yes this should be possible, but like you, I don't like this solution. It's over engineering for something that should be easy to do.

    /Claus Lundstrøm
    Claus Lundstrøm | MVP | Senior Product Manager | Continia.com
    I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
    I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
  • Johannes_NielsenJohannes_Nielsen Member Posts: 206
    Yes, in a workshop with a MS NAV Support Engineer as instructor, I was told this was an upcoming feature when RDL2010 is supported. :wink:
    Best regards / Venlig hilsen
    Johannes Sebastian
    MB7-840,MB7-841
  • Johannes_NielsenJohannes_Nielsen Member Posts: 206
    lynge wrote:
    A NAV developer wanna-bee is brainstorming. Bear with me :-)

    In the book Microsoft Dynamics NAV 2009 Programming Cookbook, page 133, Matt Traxinger first prints the report to PDF and then parses the PDF to get the last page number. He parses it with an automation he creates in Visual Studio.
    He then makes the real output using that information to create a "Page X of Y" line.

    I think this approach is kind of a mess, but I guess it might be possible to do the same in NAV 2013? (would need dot.net insted of automation to parse it on the server)

    1. For each invoice (or whatever you are printing), call the report again filtered on the current document and save it as a temp. PDF. Parse the PDF to get the last page number.
    2. Now do the real print out, include the found last page number in the dataset for Visual Studio.

    As mentioned - I'm a wanna-bee - but would this approch be possible?
    (if we forget it is a mess :-) ).

    Regards,
    Gert Lynge

    Sound like you've got at pretty good hold of things, to me :)
    Best regards / Venlig hilsen
    Johannes Sebastian
    MB7-840,MB7-841
  • clauslclausl Member Posts: 455
    Yes, in a workshop with a MS NAV Support Engineer as instructor, I was told this was an upcoming feature when RDL2010 is supported. :wink:

    MS NAV Support Engineer have the luxury that they have not signed a NDA, and can therefore talk about future NAV versions \:D/

    But I guess if MS NAV Support Engineers are talking about next version in public, all the MVPs are no longer bound by their NDA and can talk about next version???

    /Claus Lundstrøm
    Claus Lundstrøm | MVP | Senior Product Manager | Continia.com
    I'm blogging here:http://mibuso.com/blogs/clausl and used to blog here: http://blogs.msdn.com/nav
    I'm also offering RDLC Report Training, ping me if you are interested. Thanks to the 700 NAV developers that have now already been at my training. You know you can always call if you have any RDLC report issues :-)
Sign In or Register to comment.