O'Reilly logo

Microsoft Dynamics NAV 2009 Programming Cookbook by Matt Traxinger

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Display page X of Y

What sounds like a simple task is actually quite complicated in NAV. This recipe will show you how to print the total number of pages on every page of a report.

Getting ready

You must have PDFCreator installed on your machine. This recipe was tested with version 0.9.8 and 0.9.9, and is not guaranteed to work with future or previous releases of PDFCreator.

You must also have Visual Studio 2005 or later installed on your machine in order to write the C# code for this recipe.

How to do it...

  1. Create a new class library project named NAVUtilities in Visual Studio.
  2. Add a new file called PDFPageCounter with the following code:
    using System.IO; using System.Text.RegularExpressions; using System.Runtime.InteropServices; namespace NAVUtilities ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required