Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Report Structure Problem Post Reply Post New Topic
Author Message
lshakes
Newbie
Newbie
Avatar

Joined: 17 Apr 2012
Location: United States
Online Status: Offline
Posts: 4
Quote lshakes Replybullet Topic: Report Structure Problem
    Posted: 17 Apr 2012 at 1:01pm
Hi All,

I admit, I'm new to CR.  There is probably a simple solution to this issue.  I've wasted enough time on this and now I need professional help.

I have a report for work orders.  The report has a subreport for labor, equipment, and materials (In section Details a - Details c).  They all work great for showing me hours, costs and materials used.

In the report footer I have the sum of the costs from labor, equipment, and materials.  However, when I place the sum of the hours from the labor section into the report footer, it causes my report to balloon in size.  It adds data for each employee into my report.  So if there are three employees that did work in the labor section, my Work Order will be listed three different times. 

I simply want the hours spent on the work order in my report footer.  Can someone please help me?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 18 Apr 2012 at 3:43am
I think that you are asking how to sum the amounts from a subreport in the main report.
 
If so, shared variables is the answer. They typically come in groups of 3.
 
reset, typically in the group header
shared numbervar tot := 0;
"" //hides the output
 
increment (typically in the detail section, but for your case it might be in the subreport's report total):
shared numbervar tot;
tot := tot + {table.field} //for you it might be: tot := tot + sum({table.field});
""//again hide the output
 
display, usually in a group/report footer:
shared numbervar tot;
tot
 
 
HTH
IP IP Logged
lshakes
Newbie
Newbie
Avatar

Joined: 17 Apr 2012
Location: United States
Online Status: Offline
Posts: 4
Quote lshakes Replybullet Posted: 18 Apr 2012 at 4:47am
Thanks for the reply.  What do you mean "" hides the output?  I've tried finding this in the help files and online, but I can't find anything.  Where do I put the "" to hide the result.

Thanks
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 19 Apr 2012 at 5:25am
CR displays whatever the last value in the formula, so "" hides the output.
 
The person who taught me would make the font white and make the formula small and place it somewhere on the report.  Maintenance what a pain because you had the find the formula on the report. I found that adding a "" at the end of the formula would display nothing, so I could keep the formula large and not hide it in design time.
 
It's just a trick I've been using.
 
HTH
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.