Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Calculating Cumulative Totals between subreports Post Reply Post New Topic
Author Message
ggardei
Newbie
Newbie


Joined: 03 Feb 2009
Location: United States
Online Status: Offline
Posts: 13
Quote ggardei Replybullet Topic: Calculating Cumulative Totals between subreports
     Posted: 06 Feb 2009 at 1:36pm
I am currently working on designing in Crystal Reports XI the transcript reports for our Academy High school.

In my previous thread, I asked about creating two columns; the first being semester 1 and the second being semester 2. I got a lot of helpful advise and I greatly appreciated that. However; I decided to do a different approach.

I decided to use sub forms to list each semester's courses under each year Here is the basic layout

[header]

[group section   gradelevel ]

  [   semester 1 subreport ]  [ semester 2 subreport ]
  [   ... info ...                      ]  [ ... info ...]
  [  Semester Calcs            ]  [ Semester Calcs           ]

.. yadda yadda...

My question is how can I calculate and and display the cumulative calculations for each semester.

The Cum Calc formula is   sum ( gradepoints) / sum ( credits). Each semester after the first is going to be incremented by each semsters credits and gradepoints

for example

Year 1

Semester 1 Semester GPA is 3.97
Semester 1 Cum GPA is 3.97 

Semester 2 Semester GPA is 3.89
Semester 2 Cum CPA is 3.93

Year 2

Semester 1 Semester GPA is 3.95
Semester 1 Cum GPA is 3.94

Semester 2 Semester GPA is 3.10
Semester 2 Semester GPA is 3.82

... yadda yadda ...

I have done research on using variables, etc. but I couldn't get each subreport to include the previous subreport's calculations on the CumGPA variable.




         
---------------------------
George W. Gardei
IT CAMS Manager
God's Bible School and College
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 06 Feb 2009 at 5:20pm
Hi George,

The way to share data between subreports and the main report is to declare the variable as Shared. Do this in each subreport and the variable will store its value internally and used by the other subreports. Thus, you can keep adding to it in each subreport and then do a summary calculation for it in the main report.

I cover using Shared variables and other tips and tricks for subreports in my Encyclopedia book. You can find out more about my books at Amazon.com or reading the Crystal Reports eBooks online.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
ggardei
Newbie
Newbie


Joined: 03 Feb 2009
Location: United States
Online Status: Offline
Posts: 13
Quote ggardei Replybullet Posted: 06 Feb 2009 at 8:47pm
Reading this forum, I learned how to do variables, etc. I just made a mistake... I didn't specify the variables were shared.

Angry

Anyway, problem solved. Thanks for the help
---------------------------
George W. Gardei
IT CAMS Manager
God's Bible School and College
IP IP Logged
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