Count in FlowField - display the results in a Group Footer
ccernat
Member Posts: 12
Hello all!
Im new here and also to Navision scene. My problem is the following:
I have created a field in a table, type FlowField with the CalcFormula = Count("Domestic Declaration Line" WHERE (Type=CONST(Purchase),Posting Date=FILTER(01/11/12..30/11/12),VAT Registration No.=FIELD(VAT Registration No.)))
Now, this field in the Table, named "Count Purchase" has to be displayed in a report wich create some totals from this table based on some filters, etc.
I assigned a global variable cntEntries to this field from the table and I have put it in the Group Footer section of the report.
In the PreSection of the Group Footer i've put: cntEntries := DomesticDeclarationLine."Count Purchase";
Where DomesticDeclarationLine is my table and Count Purchase is my field created as FlowField wich does some counting based on the above CalcFormula.
My problem is it displays 0 all the time, although if I open the form related to that table, the counting is correct.
Where is could be the problem?
Thanks a million for any help!
Im new here and also to Navision scene. My problem is the following:
I have created a field in a table, type FlowField with the CalcFormula = Count("Domestic Declaration Line" WHERE (Type=CONST(Purchase),Posting Date=FILTER(01/11/12..30/11/12),VAT Registration No.=FIELD(VAT Registration No.)))
Now, this field in the Table, named "Count Purchase" has to be displayed in a report wich create some totals from this table based on some filters, etc.
I assigned a global variable cntEntries to this field from the table and I have put it in the Group Footer section of the report.
In the PreSection of the Group Footer i've put: cntEntries := DomesticDeclarationLine."Count Purchase";
Where DomesticDeclarationLine is my table and Count Purchase is my field created as FlowField wich does some counting based on the above CalcFormula.
My problem is it displays 0 all the time, although if I open the form related to that table, the counting is correct.
Where is could be the problem?
Thanks a million for any help!
0
Comments
-
Before assigning the value of the FlowField, you have to use CALCFIELDS statement:
DomesticDeclarationLine.CALCFIELDS("Count Purchase"); cntEntries := DomesticDeclarationLine."Count Purchase";And also you should move in OnAfterGetRecord trigger: if you need to perfom any totalization on this field, you can set it in TotalFields property of the DataItem and use directly "Count Purchase" in GroupFooter sections.* Daniele Rebussi * | * Rebu NAV Diary *0 -
Thanks alot for the reply!!
It isnt working, it outputs the same result for for all the entries.
I want to better explain the situation:
I have a GroupFooter in a report with has a GroupTotals propery by a unique VAT number and has TotalFields for the Amount corresponding to each VAT number. All this date comes from Domestic DeclarationLine table in wich I have multiple Purchase type entries for each VAT number, thus the necessity of a totalling. I needed to COUNT those Purchase entries based on certain date filters and VAT Number. And it does well at the table level. But when I put it in the Group Footer section of the report, it just outputs wrong numbers....even though I've put CALCFIELDS where you directed me to put em.
I will attach some print screen maybe it will help me to express better.0 -
I will attach one more to see where i need this field cntEntries to appear.0
-
I don't see the CREATETOTAL() in the predataitem(). I might be wrong in understating but if you want to show the total of any field in group by help of any variable then you should use this function to get the desired output.0
-
I think your data items not link correctly to purchase header. check with message in purchase header onAftergetrecord if it did have value or not.0
-
Hello,
In the property Code of the report you need to write:Shared Data1 as Object Shared Data2 as Object Shared Data3 as Object Shared Data4 as Object Public Function GetData(Num as Integer, Group as integer) as Object if Group = 1 then Return Cstr(Choose(Num, Split(Cstr(Data1),Chr(177)))) End If End Function Public Function SetData(NewData as Object,Group as integer) If Group = 1 and NewData > "" Then Data1 = NewData End If Return True End Function
Then you need to create a textbox in report body, with this code in the hidden property:Code.SetData(Cstr(Fields!1.Value), 1)
If you want tu write more fields in footer:Code.SetData(Cstr(Fields!1.Value) +Chr(177)+Cstr(Fields!2.Value) +Chr(177), 1)
Then in the textbox where do you want display the field you need to write in the value expresionCode.GetData(n,1)
if you want to display more fields you need count the position of field in the Code.SetData
I hope that works
Regads0 -
Sorry, My last post is for NAV2013 or NAV2013R20
Categories
- All Categories
- 73 General
- 73 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 327 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
