How total in a body section
DarkHorse
Member Posts: 389
Hello, I'd like to know is there is any way to total the amount of a field in a body section. It's possible?.
Thanks in advance.
Thanks in advance.
0
Comments
-
YES, O:) the question is bit ambiguous, Anyway....
1)
in body - OnPreSection()TotalVariable := TotalVariable + AmountField;
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.RecVar.Reset; RecVar.Setrange(.........); ........... ............. if RecVar.FindSet then Repeat TotalVariable := TotalVariable + RecVar.AmountField; until RecVar.Next = 0;
However, it is a good idea to do data calculations in OnAfterGetRecord() of the DataItem
I hope it helps.... O:)Sandeep Prajapati
Technical Consultant, MS Dynamics NAV0 -
Why in a body section? If you use a footer this goes almost automatically...look for example std. report 112.
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!0 -
Thanks both for reply. I need to do it in a body because after, in that body, I've to do a calculation with the total amount. I'll try that you posted.
Thanks again.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions