x
• Status: Solved
• Priority: Medium
• Security: Public
• Views: 647

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

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
kelsanit
1 Solution

Commented:

``````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 Commented:
Worked perfect!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.