I am having issues with bringing in the totals from my subreport into my main report for calculations in my main report. Thanks in advance for any help!
BACKGROUND
Both of my reports are grouped by the acct #. The subreport has my totals (@SubReport_Pmt & @SubReport_Adj) in the group footer. In the main report, I inserted the subreport into the group footer. Before I began with the calculations, I wanted to validate that the data was pulling in correctly, so I put the formula @MainFormula_Total into the group footer. The data is not reflecting on the correct records, yet I have the subreport linking the account # field in both tables.
Where did I go wrong in my coding? Or what do I need to add to get it to start at the correct position? It's almost as if it is displaying before it prints the variable data.
TABLE SAMPLES
Current:
Acct# SubReport_Pmt SubReport_Adj @mainformula_Total
0001 1344.00 0.00 0.00
0002 966.00 0.00 1344.00
0003 653.00 0.00 966.00
0004 476.00 0.00 653.00
0005 417.00 0.00 476.00
Should Be:
Acct# SubReport_Pmt SubReport_Adj @mainformula_Total
0001 1344.00 0.00 1344.00
0002 966.00 0.00 966.00
0003 653.00 0.00 653.00
0004 476.00 0.00 476.00
0005 417.00 0.00 417.00
CODE
Subreport Formulas:
SubReport_Pmt
whileprintingrecords;
SHARED CurrencyVar mytotal:= SUM({SECCHEC.HUPAMT},{@frmAccount#});
SubReport_Adj
whileprintingrecords;
SHARED CurrencyVar mytotal2:= SUM({SECCHEC.HUADJ},{@frmAccount#});
SubReport_Total
whileprintingrecords;
SHARED CurrencyVar mytotal3:=
{@SubReport_Pmt}+{@SubReport_Adj};
Main Report Formulas:
MainFormula_Pmt
whileprintingrecords;
Shared CurrencyVar mytotal;
mytotal
MainFormula_Adj
whileprintingrecords;
Shared CurrencyVar mytotal2;
mytotal2
MainFormula_Total
whileprintingrecords;
Shared CurrencyVar mytotal3;
mytotal3