Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Passing values from subreport to main report in Crystal Reports 10

Posted on 2008-06-23
8
4,070 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

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
 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

1. Set up your parameter at the report level as usual, check the box Multi-value, and set the Data Type to String 2. Set the Stored Procedure Parameter to varchar(max)  --<---- This part here is the key to it's success Example:    @cst_key var…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used.

792 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