How should I calculate the sum per page in a report


I am a beginner in developing in Microsoft Dynamic Nav. The version I am using is Microsoft Dynamic nav 5.0.

I have problem with calculating the sum per page for some decimal fields in a report. I have no idea of how sum per page can be calculated in a report. I have tried and I can calculate only progressive sum. Please help me

I am open to any sugestion.

Thanks a lot

Hi Magdalena,

Firstly, welocme the the Dynamics User Group.

The standard way to solve this is to use the CurrReport.CREATETOTALS command to keep a running total and then place the variable in the TransFooter/TransHeader sections. Have a look at the standard invoices (report 206) for an example.

Thanx a lot Dave,

I tried this method but this printed progressive sum, not sum per each page, because what I want is the sum in every page, so for the values that are in only that page. This will be repeated for each of them. Could you please help me.


Two methods:

  1. Use the progressive total and save the value on each page and subtract from the progressive total

  2. Create a manual total and total in the dataitem, then print on the TransFooter and reset to zero when printed.

Hi Dave,

If I use the first method that you recomended me that was “Use the progressive total and save the value on each page and substract from the progressive total”, could you please tell me what is the code that I should write for this purpose because the save value property for the textbox does not exist and I have no request form for the report that I am modifying.

Thanks a lot


Something like - in the OnPreSection of the transfooter

PageTotal := LineAmount - PreviousTotal;

PreviousTotal := LineAmount;

Where LineAmount is the variable you used in CREATETOTALS