Printing Subtotals in the Footer of the last page using Microsoft Dynamics GP Word Templates

With the introduction of Word Templates we have found it difficult to format Word documents, so they are always printing the subtotal at the very bottom of the last page.  We in support have successfully created Word functions to accomplish this with the help of Nathan Adams on the Word Team.  Below are the steps to successfully place the Subtotal section of the Reports at the very bottom of the page.

Note: This Customization will only work if you are printing a single document.  If you are printing this by batch you will run into issues with the Subtotal only printing on the last page.  This is set to be fixed in GP 2010 SP3.

1. Open the Template you would like to modify the subtotal on.  In this example I am going to use the Original SOP Blank Invoice.
(Reports | Template Maintenance | select Report Name:  SOP Blank Invoice Form (Original) | Click Modify)

2. The current location of the Subtotal section is right underneath the lines.  We will need to create Word Field Codes and add the Subtotal table into the Footer section.

3. To create the Field Codes you will need to add the following to the Footer of the Report.
a. While in the Footer you can Toggle field codes by clicking Alt + F9.  (Make sure your Keyboard has the F Lock turned on).
Note: To insert brackets for the field codes you need use Crtl + F9.  They will look like this { }
b. Type the following:
{ If { page } = {numpages} “paste your table here"}
c. you will now Copy and Paste the Subtotal table after the first quote.  It should look like this now:

(You will leave the original table in the same location.  You will just remove the Content Control and fields.  This will fix a Page number issue)

4. Make sure to un-toggle your Field codes by clicking ALT + F9.

5. Save the document and re-import the Template using Template Maintenance.

6. Now when you print the SOP Blank Invoice the Subtotal section will always be at the bottom or the last page.  Here is an example of a 2 page document: (I outlined the subtotal in Red.

I hope this helps!

Andy S. 

Comments (6)
  1. Jocelyn Sicard-Dequoy says:

    It works very well for the subtotal at the end of the document, but it create a Syntax Error in the number of page in the header.  I check your screen shot and you seem to have the same error than me, do you have a solution to fix it ?

    Thank you

  2. Andy Sather says:

    Hello Jocelyn – Thank you for the update.  I never noticed that.  I have sent a message over to our Word Team to see what is wrong.  The odd thing is the Template does not show this error message.

    I will keep you posted.

  3. Kanti says:

    Hi Andy,

    Excellent work and help us resolve one of the burning issue with the client.

    Also one final thing in the IF statement you need to add false statement to resolve the issue with the syntax.

    Thanks again for the solution.


  4. Cheap printing says:

    Nice post.I like the way you start and then conclude your thoughts. Thanks for this information .I really appreciate your work, keep it up

    <a href="">Cheap printing,/a>

  5. Andy Sather says:

    Hey Kanti – The only way I could get this to work was to remove the Page Number and go to Insert | Page Number in the Header & Footer section of the Word Ribbon.  When you created the False Statement what did this look like?  You can also email me at

  6. Andy Sather says:

    Updated post to include the Page number workaround and update on SP3 fix for printing via batch or having a Terms and Conditions page.

Comments are closed.

Skip to main content