Print Page | Close Window

Group Total of Shared Variable Values

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=19195
Printed Date: 03 May 2025 at 6:29pm


Topic: Group Total of Shared Variable Values
Posted By: pjmatelli
Subject: Group Total of Shared Variable Values
Date Posted: 28 Feb 2013 at 10:44am
Hello,
I am new to this forum and have been reading and searching through the posts.  I have not been able to find my specific problem, so here it is:

I have a report which displays Freight Bills (FBs) that rode a trip (trucking business).  Those FBs have weights on them.  FB 1 can ride trip #2000, and can be on Leg 1 and Leg 2 of a 3 Leg trip.  I have figured out how to get a sum of the weight in a subreport.  I pass that value to the main report via a shared variable and place that value in the Group footer (grouped by Trip #).

What I need to do now is at the next group level (grouped by company in a multi-company environment) get a total of those weights for the company.  Here is an example of the data

Company 1
  Trip #2000
    Leg 1
      FB1     500
      FB2     750
      FB3     250
    Leg 2
      FB1     500
      FB2     750
    Leg 3
      FB2     750
  Trip #2001
    Leg 1
      FB1     750
      FB2     500
    Leg 2
      FB1     750

Trip #2000 - Total Weight is 1,500 (I can get this number)
Trip #2001 - Total Weight is 1,250 (I can get this number)

The trip total weight is a value in a subreport that I am using in the main report via a shared variable.

My question is:  how can I get my report to total the weight of 1,500 + 1,250 for the company?

Thank you in advance for any and all help and guidance.  I hope my explanation is clear.

         



Replies:
Posted By: lockwelle
Date Posted: 16 Apr 2013 at 7:31am
use another variable to accumulate the total value for the next group. Remember to initialize it in the group header.

HTH



Print Page | Close Window