It looks like you're new here. Sign in or register to get started.
TotalVariable := TotalVariable + AmountField;
RecVar.Reset; RecVar.Setrange(.........); ........... ............. if RecVar.FindSet then Repeat TotalVariable := TotalVariable + RecVar.AmountField; until RecVar.Next = 0;
Comments
1)
in body - OnPreSection() This will keep adding the amount field in TotalVariable which can be used.
2) In the body section we can use record variable....and total a field of that record.
e.g.
However, it is a good idea to do data calculations in OnAfterGetRecord() of the DataItem
I hope it helps.... O:)
Technical Consultant, MS Dynamics NAV
Anyway, there are other examples like report 121 where a total is made by a new variable...
CurrencyTotalBuffer.UpdateTotal(CurrencyCode,RemainingAmt,0,Counter1);
So meaning : you create a variable where you continuously add a value and you print that :
dectotal := dectotal + amounttoadd
Small trick : check out some standard reports, if Nav can do it, you can do it!
Thanks again.