Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Grand Total of totals in Subreports Post Reply Post New Topic
Author Message
Ghauri
Newbie
Newbie
Avatar

Joined: 27 Nov 2007
Location: Pakistan
Online Status: Offline
Posts: 13
Quote Ghauri Replybullet Topic: Grand Total of totals in Subreports
     Posted: 15 May 2008 at 11:28pm

 Hi,

Its a very basic question and I'm sure it will be very easy but I am unable to get on it please help.
 
I have a report which has 4 subreports, each sub report have a Sum (calculated on a group), I have to show the GRAND TOTAL of all sum calculated in 4 sub reports, For Instance
 
GRAND TOTAL = SUM(subreport1) + SUM(subreport2) +SUM(subreport3) +SUM(subreport4)
 
I tried with Global NumberVar GRANDTOTAL in a formula of main report,but GRANDTOTAL is not visible in subreports.
 
Regards,
Ghauri
Thanks & Regards,
Ghauri
IP IP Logged
Debbie Giles
Newbie
Newbie
Avatar

Joined: 16 May 2008
Online Status: Offline
Posts: 10
Quote Debbie Giles Replybullet Posted: 16 May 2008 at 2:46am

What a good question.  I'd love to know the answer.

When faced with the same problem last week i simply added another sub-report with the totals including all four parameters.

Debbie
Debbie Giles
Syspro Consultant
EOH
+27 21 525 7200
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 16 May 2008 at 4:48am
You have to use a shared variable to cross the "subreport barrier."  The scope rules for variables are:

Local - anything in this formula
Global - anything in this report
Shared - anything in this report or any subreports

Just create either four shared variables or a shared array.  In the report footer of each subreport, store the total to the shared variable.  In the report footer of the main report, sum the shared variables or array.


IP IP Logged
Ghauri
Newbie
Newbie
Avatar

Joined: 27 Nov 2007
Location: Pakistan
Online Status: Offline
Posts: 13
Quote Ghauri Replybullet Posted: 18 May 2008 at 10:11pm
Hi Lugh,
 
Thanks for your help, I'll be very thankful if you email me an example report.
Actually I tried in many ways but don't what is the discrepensy Confused
 
Please send sample report on my email
 
 
 
Thanks & Regards,
Ghauri
Thanks & Regards,
Ghauri
IP IP Logged
Ghauri
Newbie
Newbie
Avatar

Joined: 27 Nov 2007
Location: Pakistan
Online Status: Offline
Posts: 13
Quote Ghauri Replybullet Posted: 18 May 2008 at 11:07pm
Thanks,
 
    I have succeeded in getting the desired result.
 
Regards,
Ghauri
Thanks & Regards,
Ghauri
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