Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

# Crystal Report - SUM Values (variables) from sub report

Posted on 2013-06-26
Medium Priority
639 Views
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
Question by:kelsanit
[X]
###### 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

LVL 101

Accepted Solution

mlmcc earned 2000 total points
ID: 39279524

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

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

In the group 1 footer add a formula

``````WhilePrintingRecords;
Global NumberVar LineHoursTotal;
LineHoursTotal
``````

mlmcc
0

Author Closing Comment

ID: 39279601
Worked perfect!
0

## Featured Post

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
###### Suggested Courses
Course of the Month10 days, 5 hours left to enroll