How to obtain a value within a report

tazzy30
Member Posts: 52
I have created a Report to count Shipment headers and lines, I now want to loop through the lines to create a Total Value of all the Sales Shipment Lines on the report but i'm not sure what code to put in.
Can anyone help?
Thank You
Can anyone help?
Thank You
0
Comments
-
If you create a Global "TotalAmount" as a decimal.
Then in the data item enter
TotalAmount := TotalAmount+"Shipment lines" ;
In the sections enter a footer with a text box. I properties ad the source expression "TotalAmount".
Regards
Michael M0 -
Or use
CurrReport.CREATETOTALS(MyDecimalVariable);
0 -
Thank you both for your replies.
I used Michael's solution which works fine, but when i do the same for Sales Credit Memo's (same report different data item) I get the inccorect total, would it need to be calculated differently?0 -
You have to be careful.
If you manually calc the totals, then if at some section you have SHOWOUTPUT(..)
then you might get unprinted records that participate in the total. You have to look at the general picture of the report mechanism to figure out what to do.
You could also move your code at a post section trigger. Also if you need to print totals in Groupfooters and TransferFooters (or headers) you might end up with wrong results...0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions