Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Adding Subreport Totals Post Reply Post New Topic
Author Message
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Topic: Adding Subreport Totals
    Posted: 18 Jun 2007 at 6:41am
Hi There,
 
I have a report  where i want to do the following
 
Main report
Has Subreport 1 with Total 1 which is in a group
Main report also has
       Subreport 2  with  Total 2 which is in a group
 
I want to use sum of total2 to add to Sum of total1 and display in Subreport 1 as new total is that possible.......
 
Thanks
Rahul
 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 18 Jun 2007 at 12:02pm
Yes, this is possible.  You'll need to create "Shared Variables" to do it. 
 
You'll have to do something like this (you'll probably have to tweak this, and Brian may have a better answer...).
 
Formula in Main Report
Shared Numbervar Total1;
//Initialize at start of report
If previousIsNull({table.some key field}) then Total1 := 0; 
 
Create a similar formula for Total2.  Create another formula to add them together.
 
Formula in Subreport 1
Shared Numbervar Total1;
Total1 := Total1 + <whatever you need to do to get Total1>
 
Do the same sort of thing with Total2 and Subreport 2.
 
In order to get the correct result, you'll probably have to put your formula that adds Total1 and Total2 in a group or report footer.
 
-Dell
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.035 seconds.