Cannot sum the right value from subreport
Posted: Fri Dec 07, 2012 3:52 am
Hello,
This report calls the SubReport2 and want to return the sum of fields from SubReport2 to MainPage but there are 2 problems for sum of two fields. Please read the attached file and the following for the details.
1. It shows the Text11 "payment1.sumpaidamt1" in DataBand3 of Page_SubReport2. I want to show the sum of this field.
The Text31 "{Sum(payment1.newcontractid==loaninfo.contractid?payment1.sumpaidamt1:0)}" is shown in the GroupFooterBand1 of Page1.
The problem is: there are 3 records in SubReport2, it shows sum of these 3 records, but it only sum the 3rd records.
2. The Text22 "{sumSettle=SumIf(DataBand1,payment1.sumpaidamt1,payment1.newcontractid==loaninfo.contractid)}",
I assign toe variable "sumSettle". Then, the Text32 "{Sum(DataBand1,sumSettle)}" should be shown the sum of Text22.
The problem is: there are 3 records, it should be sumed of field Text32 but it sum 3 times of the 3rd records.
Thanks,
Super Bread
This report calls the SubReport2 and want to return the sum of fields from SubReport2 to MainPage but there are 2 problems for sum of two fields. Please read the attached file and the following for the details.
1. It shows the Text11 "payment1.sumpaidamt1" in DataBand3 of Page_SubReport2. I want to show the sum of this field.
The Text31 "{Sum(payment1.newcontractid==loaninfo.contractid?payment1.sumpaidamt1:0)}" is shown in the GroupFooterBand1 of Page1.
The problem is: there are 3 records in SubReport2, it shows sum of these 3 records, but it only sum the 3rd records.
2. The Text22 "{sumSettle=SumIf(DataBand1,payment1.sumpaidamt1,payment1.newcontractid==loaninfo.contractid)}",
I assign toe variable "sumSettle". Then, the Text32 "{Sum(DataBand1,sumSettle)}" should be shown the sum of Text22.
The problem is: there are 3 records, it should be sumed of field Text32 but it sum 3 times of the 3rd records.
Thanks,
Super Bread