Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Total a shared varable in main report 1

Status
Not open for further replies.

rpetry

Technical User
Sep 29, 2011
2
US
I have been working with Crystal for about 10 years, but am fairly new to shared variables. I have a report that has a shared variable reporting in the details section and now I need to total it in the group footers and a grand total at the bottom. Is there a formula I need to create to accomplish this, or do I need more shared variables to pull totals from the subreport?

my shared variable is named 'CommittedTotal'.
 
Insert a detail_b section and add a formula like this to it (you can suppress this section):

whileprintingrecords;
shared numbervar CommittedTotal;
numbervar grpsum := grpsum + CommittedTotal;
numbervar grtot := grtot + CommittedTotal;

Then add a reset total to the group Header:

whileprintingrecords;
numbervar grpsum;
if not inrepeatedgroupheader then
grpsum := 0;

Add a display formula for the group footer:

whileprintingrecords;
numbervar grpsum;

Add a display formula for the report footer:

whileprintingrecords;
numbervar grtot;

-LB
 
Thank you so much, this works perfectly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top