Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: weekly sum from subreport need in main report Post Reply Post New Topic
Author Message
sam_semillia
Newbie
Newbie


Joined: 22 May 2012
Online Status: Offline
Posts: 7
Quote sam_semillia Replybullet Topic: weekly sum from subreport need in main report
     Posted: 22 May 2012 at 2:06am
Hello,
 
I would have the following problem:
 
I am currently having 1 main report and 2 subreports. In both subreports a weekly sum of sales is calculated and grafically displayed via a chart. Both subreports use different db tables.

ie:
SubReport_1: tbl_Product_A
Subreport_2: tbl_Product_B
 
In subreport 1 the total amount of sales of product A is calculated on a weekly base.
 
In subreport 2 the total amount of sales of product B is calculated on a weekly base.
 
Now I would need the weekly sums of both sub reports within my main report in order to calculate the amount of total sales of product A + product B on a weekly base.

Unfortunately, I fail on doing that. I tried to add the weekly sub totals to a shared array in order to use it in my main report, but this causes me to have loads of variables within my main report.

Is there any way of accomplishing this in an easy way?
 
I hope I expressed my prolem as clearly as possible and I hope someone can help me.
 
Thanks a lot, cheers.


Edited by sam_semillia - 22 May 2012 at 2:07am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 23 May 2012 at 6:01am
no. shared variables are the only option to get a value from a different report.
IP IP Logged
sam_semillia
Newbie
Newbie


Joined: 22 May 2012
Online Status: Offline
Posts: 7
Quote sam_semillia Replybullet Posted: 23 May 2012 at 6:19am
Thanks a lot for your reply.

As you suppose shared variables, I would be in need of loads of shared variables within my main report (each week, each product). So, my dreams of accomplashing this will end in smoke, right?

cheer


Edited by sam_semillia - 23 May 2012 at 6:20am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 23 May 2012 at 6:27am
well, you mentioned an array, you could put everything into 1 array (if the number of values are constant) and then just pass that back and forth.
 
it would be hard to maintain without documentation since no one would know what supposed to be in each of the array elements.
 
it's a thought.
 
if things are dynamic and the number of values for each array are not known for each report...it would be a nightmare...not impossible, just a nightmare.
 
good luck
 
just as note, I have regular reports that have 3 or 4 variables per goup and 5 - 6 grouping levels...so I am tracking 20+ variables...so nothing is impossible...just more complex


Edited by lockwelle - 23 May 2012 at 6:28am
IP IP Logged
sam_semillia
Newbie
Newbie


Joined: 22 May 2012
Online Status: Offline
Posts: 7
Quote sam_semillia Replybullet Posted: 01 Jun 2012 at 11:56pm
Thanks for your help, but I achieved what was need with a simple "UNION" of the tables!

thx, sam
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