Solved

Crystal Report - SUM Values (variables) from sub report

Posted on 2013-06-26
2
628 Views
Last Modified: 2013-06-26
Attaches is a crystal report that has a single sub report in which I declare several values and call in the main report. I use one of these values to calc. "Line Hours" in a formula. I need to sum the result of this field in the FOOTER.

I have seen this done before but cannot remember or find the correct steps.

Examples from crystal report:
Date: 6/26/2013
gallon line hours: 21.17
Quart line hours: 9.65
Pail line hours: 1.18
Drum: .39

Want to display the total of these values in the footer: 32.39
Production-Planning-Dashboard.rpt
0
Comment
Question by:kelsanit
2 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 39279524
Add a formula to the report header and the group 1 header

WhilePrintingRecords;
Global NumberVar LineHoursTotal;
LineHoursTotal := 0;
""

Open in new window


Try using this as the #Line Hours

WhilePrintingRecords;
shared numbervar changeover;
shared numbervar scheduledqty;

Global NumberVar LineHoursTotal;

Local NumberVar numOut := 0;

If {@packgroup}="sink pac" then
    numOut := scheduledqty / 25
Else If {@packgroup} IN ["gallon", "quart", "pail", "drum"] then
    numOut := changeover * 0.25;

 If {@packgroup} = "gallon" then
    numOut  := numOut  + scheduledqty  / 125
Else  If {@packgroup} = "quart" then
    numOut  := numOut  + scheduledqty  / 85
Else  If {@packgroup} = "pail" then
    numOut  := numOut  + scheduledqty  / 130
Else  If {@packgroup} = "drum" then
    numOut  := numOut  + scheduledqty  / 25;

LineHoursTotal := LineHoursTotal + numOut ;

numOut  

Open in new window


In the group 1 footer add a formula

WhilePrintingRecords;
Global NumberVar LineHoursTotal;
LineHoursTotal

Open in new window


mlmcc
0
 

Author Closing Comment

by:kelsanit
ID: 39279601
Worked perfect!
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

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. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
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 …

867 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

15 Experts available now in Live!

Get 1:1 Help Now