Hello!
My goal is to create a report that sums up values Acquisition Cost, Depreciation & Book Value of Fixed Assets by FA Location.
I create the below DataItems and set FA Depreciation Book as a child:
Fixed Asset:
DataItemTableView: SORTING(FA Location Code) ORDER(Ascending)
GroupTotalFields: FA Location Code
FA Depreciation Book:
DataItemTableView**:** SORTING(FA No.,Depreciation Book Code) ORDER(Ascending)
DataItemLink: FA No.=FIELD(No.)
Please correct me if i am wrong but since the values i want to sum up are FlowFileds i cannot use the GroupTotalFields feature.
So i created Global Decimal variables to store the sums and run the addition on OnAfterGetRecord trigger of FA Depreciation Book data item:
gGroupAcqCost += “Acquisition Cost”;
gGroupAccuDepr += Depreciation;
gGroupBookValue += “Book Value”;
Now the addition continues in all Groups resulting the Total of all Fixed Assets by the end of the last FA Location Group. I know i have to CLEAR my variables by the end of each Group.
I tried Fixed Asset OnAfterGetRecord & OnPostDataItem or even Fixed Asset GroupFooter - OnPostSection triggers. No matter what, all my Group totals end up with zero or wrong values.
Any pointers would be greatly appreciated.
Many thanks in advance for your time!
Regards,
CM