Dec 6, 2019

Print Report Header & Footer - NAV 2013 / 2015 / 2016 / 2017

Problem :-

There are range of posted invoices that needs to print at once. The first one has two pages & the second one has three pages, likewise there are multiple pages for each invoice.

  When printing those invoices, header information should be visible on all pages, but footer needs to visible only on last page.
Eg :-

Solution :-
Create a new report. Add "Sales Invoice Header" & "Sales Invoice Line" as data items. Then on report layout,

  • Group body section for the invoice number.

    • Add a table and remove the header row.


    • Remove all columns but, keep only one cell with details group.


    • Group the cell by invoice number. Add page break for each group.
               

    • Insert a rectangle into the cell & add other necessary controls on top of that rectangle. 
     After completing the body section you can run the report. If you run the report for range of invoices, it will create a new page for each invoice.

Now you want to print the header & footer sections. 
     At this point if you run the report after adding some fields to the report  header & footer, you can see that the very first invoice details of your selected range are taken to the header, while the last invoice details are taken to footer.
    This happens because, the header & footer sections does not have any connection with the group on body section.