Passing values from subreport to main report in Crystal Reports 10

I have two subreports in a main report.  One subreport lists and calculate the total billings by Job for a certain time period.  The other subreport lists and calculates the charges by Job Phase and then by Job by the same time period.  I need to pass the calcuated variables (total billings) and (total charges) by Job to the main report so that I can do a profit/loss calculation.  I've attached the report for your viewing- please change extension back to .rpt.  Thanks!!  Any help is always appreciated...
JobCost.txt
stephaniem712Asked:
Who is Participating?
 
mlmccConnect With a Mentor Commented:
Use separate variables for each report.

CHange you formula in the main report header to something like this

WhilePrintingRecords;
Shared NumberVar BillingTotal := 0;
Shared NumberVar ChargeTotal := 0;

In the billing subreport use the BillingTotal variable
In the Charge subreport use the ChargeTotal variable

Add a formula to the group footer to do the calculations
WhilePrintingRecords;
Shared NumberVar BillingTotal;
Shared NumberVar ChargeTotal;

Calculations

mlmcc
0
 
stephaniem712Author Commented:
I read that article.  But, this is a little more complicated.  I need to do a calculation by Job.  So from the subreport, I need to basically pass a "subtotal" by Job for the Billings subreport and the Charges subreport.  On the main report, I need to do a calculation using these two figures to calculate a profit/loss by job.  I'm stuck...
0
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
stephaniem712Author Commented:
I put

WhilePrintingRecords;
Shared CurrencyVar BillingTotal;
Shared CurrencyVar ChargeTotal;
(BILLINGTOTAL-CHARGETOTAL);

in the group footer.  I'm doing something wrong.  All I get is the Billing Amount instead of the Billing Amount less the Charge Amount....  I'm drawing a blank...

Thanks!
0
 
mlmccCommented:
Did you change the subreport formulas and the formula in the report header?

mlmcc
0
 
stephaniem712Author Commented:
yes
0
 
mlmccCommented:
Can you attach the new report?

mlmcc
0
 
stephaniem712Author Commented:
My error.  I put chargetotal instead of chargestotal...  left off the s.  Thanks for your help!  It looks like it's working now...
0
All Courses

From novice to tech pro — start learning today.