Solved

Passing values from subreport to main report in Crystal Reports 10

Posted on 2008-06-23
8
4,055 Views
Last Modified: 2013-11-15
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
0
Comment
Question by:stephaniem712
  • 4
  • 3
8 Comments
 
LVL 13

Expert Comment

by:crgary_tx
ID: 21847914
0
 

Author Comment

by:stephaniem712
ID: 21848053
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
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 21848415
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
 

Author Comment

by:stephaniem712
ID: 21849879
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 100

Expert Comment

by:mlmcc
ID: 21850110
Did you change the subreport formulas and the formula in the report header?

mlmcc
0
 

Author Comment

by:stephaniem712
ID: 21850272
yes
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 21850337
Can you attach the new report?

mlmcc
0
 

Author Comment

by:stephaniem712
ID: 21850352
My error.  I put chargetotal instead of chargestotal...  left off the s.  Thanks for your help!  It looks like it's working now...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
IF THEN Statement not working 3 39
C# Crystal Reports 15 79
Tools to Output documents from DB based on selections 8 113
A string is required here error 20 11
Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now