Tables in footer section of a report?


I’ve a problem…

I must print a report on a form. The printing paper already has specific boxes printed at the bottom of the page.

These boxes must contain information about VAT of the items. There could be various VAT codes. Then they must contain the total of VAT amount and some other information.

For example I’m using “206 - Sales Invoice” and the VAT table with these information, is already in the body of the report. I need to put it in the footer of the report because the position must be fixed and not to depend on the lenght of the body.

I tried to move (in the “Sections” window of the classic client) all the fields in the footer part… but when I open the “Layout” these fields disappear.

I know that I cannot use tables in the footer sections, nor single fields, but for single fields the solution is to get them by code, using a combination of “SetCode” and “GetCode”… and it works… but not for a Table (with its lines and totals)

Is there a solution?


(excuse my not so good english and my difficulty to explain myself properly and with full details)

You could put the values you need in Variables, and use these in the footer section.

Hi Atreiu,

When you design a report, you design the actual layout through the section-designer.

There are different types of sections, to be used for different purposes.
One of the section-types is a footer. And this is the one you want to use for your purpose.

The footer-section is printed after nav has looped through all records in that particullar dataitem, wich makes ideal (and also intended originally) to printing totals.

Once again i must advertise for the Application Designers Guide…
It can be found on the product-CD in the Doc-folder, and is called w1w1adg.pdf.
Appendix B of this manual contains flowcharts for a report, and might give you an idea on where to do certain types of tasks.

I’ll try to explain it in the best way…

My only need is to put some information at the bottom of the page. If I could do this using the body section… everything would be easy… but the body section has dynamic dimensions…

I’ve gone in the “section designer” and tried to put the fields in the footer section of the page, called “PageLoop, Footer”. But I need to put not only the totals into it, but also the records.
I thought that moving these things from the body was enough for having these visible in the layout… but it was not…

I’m reading the Application Designers Guide… but nothing useful to me… until now…

I should leave the fields and totals in the body… and then create some variables… and then?


Well, if you insert a new integer-dataitem, just after the dataitem that contains the data you want printed.
Indent it under the original dataitem, and set the properties so that integer is limited to 1.
Then insert a footer-section of the new integer-dataitem, and set the properties on that to PlaceInButtom = Yes.

Hope i have understood your task correctly.

Ok, this works in the classic client, Sections window. But that not guarantee that it works in the same way also in the layout designer.

The way that nav classic uses to build totals is not the same used by the new report designer (similar to reporting services). The report designer simply use a box with the “Sum(Fields!VATAmount…” for the total of all the lines having the “Fields!VATAmount” field.

My problem is getting this total and all the single fields in the footer section of the page in report designer of RTC.

Hi Atreiu,

my assumption was, that you want to print the totals of the different VAT Codes, and that in the Form, there is a specific number of these Codes with a corresponding field (maybee even specified field location) for the different Codes. So you know at design time, which and how many Totals you have to maintain and print.

In this scenario, you can sum the values for the different VAT Codes in Variables, and then print the value of these Variables in the Footer Section at the specific location you need.

However, I have no idea (yet) if this will work in the new report designer.


I was ill last week.

Before trying to put the totals for the vat codes in variables, I tried a simple step: I tried to get just a simple field. And I failed…

There is the table “112 - Sales Invoice Header” that contains the field “Amount Including VAT”. So I created a variable “AmountInclVAT” (of “Record” DataType) pointing to the “Sales Invoice Header” table.
Then I created a textbox in the PageLoop Footer that used AmountInclVAT.“Amount Including VAT” as SourceExpr.
I run the report in classic designer but the field return the value 0,00 instead of the right value.

Where did I make a mistake?

Hi, my first guess would be, that you forgot to use CALCFIELDS (either in the property Section for the “Sales Invoice Header” or in the code), since the field is a FlowField.

Then again, I would create a Decimal (Array) Variable (Name = VATAmount), and assign the “Amount Including VAT” to that (to tell the truth, I don’t get why you would want to use a Record Variable).

So my code would look something like this:

Sales Header - OnPreDataItem()

CALCFIELDS(“Amount Including VAT”)

Sales Header - OnAfterGetRecord()

VATAmount[1] := SalesHeader.“Amount Including VAT”

I admit my ignorance about Navision code. So thank you for your help & patience

I tried the following:

  • I created a Decimal variable called: AmountInclVAT

  • I put a textbox in the PageLoop Footer section having the SourceExpr: AmountInclVAT
    (the AutoCalcField is set to “yes”)

  • wrote the code:

Sales Invoice Header - OnPreDataItem()

CALCFIELDS(“Amount Including VAT”)

Sales Invoice Header - OnAfterGetRecord()

AmountInclVAT := “Sales Invoice Header”.“Amount Including VAT”

(“Sales Invoice Header” is the name of the table where the “Amount Including VAT” is stored… is it correct?)
it still gives 0,00…



I’ve set the variable as Decimal with 3 dimensions (in the properties)

then was only a matter of wrong place:

Sales Invoice Header - OnAfterGetRecord()

CALCFIELDS(“Sales Invoice Header”.“Amount Including VAT”);

AmountInclVAT[1] := “Sales Invoice Header”.“Amount Including VAT”;