Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Sum of multple created sub reports Post Reply Post New Topic
Author Message
chrisfaw
Newbie
Newbie
Avatar

Joined: 26 Apr 2016
Online Status: Offline
Posts: 13
Quote chrisfaw Replybullet Topic: Sum of multple created sub reports
    Posted: 26 Oct 2016 at 12:04am
Hi CR Experts

I have 1 sub-report which is filtered by a field in the main report.  The report will sometimes be filtered with more than one result therefore creating multiple  sub reports.

What I now need is to pass the sum of all the multiple reports back to the main report.

e.g. What I am currently doing is passing the below field to the main report.  What it is returning is one of the multiple reports sums. What I need is the sum of all the reports created e.g. the sum of subval10

whileprintingrecords;

SHARED Numbervar  subval10;

subval10;

Sorry if this is something obvious.    Many Thanks

Chris :-)




IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 27 Oct 2016 at 5:47am
It would seem that you need to keep adding to the variable. I know, general answer, vague.

Shared variables are the way to go...just each instance of the subreport needs to update the variable, at least that is what I would do.

HTH
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 02 Nov 2016 at 5:59am
Hi

Where you want to display the cumulative summary all sub report values ? Is it for each group or at report footer level?

If it is at report footer level, then create a formula like :

Whileprintingrecords;
Shared Numbervar ubval10:=subval1+subval2+subval3+....

the formula should be below all sub reports and then use below to display cumulative summary :

whileprintingrecords;
Shared Numbervar subval10;

Thanks,
Sastry
Thanks,
Sastry
IP IP Logged
chrisfaw
Newbie
Newbie
Avatar

Joined: 26 Apr 2016
Online Status: Offline
Posts: 13
Quote chrisfaw Replybullet Posted: 04 Nov 2016 at 5:01am
Hi

Thanks for your reply.  I am not sure if I was clear enough in my question.

I only have one sub report.
I have a shared string Qty from the main report to the sub report.
The shared string multiples the sub report total at footer level or at group level (as there is only one group per report) and is shared back to the main report.
When the report is generated the one sub report will generate multiple reports.
When I share the field back to the main report only the final returned sub report results are shared.
Is there a way a can sum the above for each report which is generated from the one sub report and return.


Many Thanks

Chris :-)



 


Edited by chrisfaw - 04 Nov 2016 at 5:05am
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.021 seconds.