Problem Totaling a Report

xina_man
Member Posts: 116
Hi there!
I'm having a problems calculating a value in a report.
In the report of purchase receipt line i want to calculate the amount of the "qty received not invoiced"... in the body section it's easy to do it (qty received not invoiced*unit price in the SourceExpr properties).
Now i want to create a total with the previously calculated field in the footer section...
Can anybody help me with that?
Many thanks
I'm having a problems calculating a value in a report.
In the report of purchase receipt line i want to calculate the amount of the "qty received not invoiced"... in the body section it's easy to do it (qty received not invoiced*unit price in the SourceExpr properties).
Now i want to create a total with the previously calculated field in the footer section...
Can anybody help me with that?
Many thanks
0
Answers
-
Use some new variable and the value save into it. In the source expression use the variable instead the expression. Than you can use the CurrReport.CREATETOTALS(myvariable) for creating automatic totals of the variable.0
-
kine wrote:Use some new variable and the value save into it. In the source expression use the variable instead the expression. Than you can use the CurrReport.CREATETOTALS(myvariable) for creating automatic totals of the variable.
I'm not a C/AL programmer so I dont know the code for do that task. Is it possible to give me de code for this task?
Thanks&Regards0 -
xina_man wrote:kine wrote:Use some new variable and the value save into it. In the source expression use the variable instead the expression. Than you can use the CurrReport.CREATETOTALS(myvariable) for creating automatic totals of the variable.
I'm not a C/AL programmer so I dont know the code for do that task. Is it possible to give me de code for this task?
Thanks&Regards
Problem Solved!!!
Many Thanks0 -
1) Create new global variable e.g. with name "ReceivedNotInvAmount" with type Decimal
2) In the correc dataitem add code (expression is same as you are using in the section in SourceExpr) into OnAfterGetRecordReceivedNotInvAmount := "qty received not invoiced" * "unit price";
3) Add this code into OnBeforeDataItemCurrReport.CREATETOTALS(ReceivedNotInvAmount);
4) Use the ReceivedNotInvAmount variable everywhere you want to print the amount. If it will be in Footer section, it will print the total.0 -
- Define a global variable ex: MyGrandTotal
- Write this code to "Purch. Rcpt. Line" DataItems OnAfterGetRecord Triggger
Code:
MyGrandTotal := MyGrandTotal + (qty received not invoiced*unitprice );
- Add a text box to Purch.Rcpt.Line footer section
- Write MyGrandTotal to text box's SourceExpr property
- Run the report0
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