Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Use a calculated value in subreport in main report Post Reply Post New Topic
<< Prev Page  of 2
Author Message
cwhitmore
Newbie
Newbie


Joined: 02 Sep 2009
Location: United States
Online Status: Offline
Posts: 16
Quote cwhitmore Replybullet Posted: 19 Nov 2009 at 6:33am
the subreport is grouped by market, the main report is grouped by market and location. My data is totaled in the subreport by market and the data in the main report is totaled by location. In short, the market subreport is an aggregate of the main report. the data in the main report is displayed in location footer and the data in the subreport is displayed in the market footer. I would like the shared value from the subreport displayed in the main report. So far when the shared value is displayed in the main report, it is one record behind. So on the first record the shared value is "0", but the second record the shared value is "16". The "16" i want displayed on the first record.
 
Cecil
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 23 Nov 2009 at 6:21am
you got me...you want a value, from what amounts to a future line, to be displayed in the current line.  You might try calling the subreport using the value from the 'NEXT()' field, but no guarentees.
 
This is kind of a thorny quandry.  I would bring out the next value in a new column in the result set (I use stored procs and can accomplish this...I think, but it probably won't be easy/pretty).  Crystal, and just about every reporting system out there, is set up to deal with values in the this row of the data, so pointing to another row in the data is an iffy proposition and may not be doable.
IP IP Logged
cwhitmore
Newbie
Newbie


Joined: 02 Sep 2009
Location: United States
Online Status: Offline
Posts: 16
Quote cwhitmore Replybullet Posted: 23 Nov 2009 at 1:10pm
I really appreciate your follow-up.  I was able to get my report to work with a little trickery of grouped fields. It seems i was getting "0" on the first record because the subreport that uses the shared varible was not being calcluated before i displayed the results of the shared variable, in this case the market results needed to be calculated first. So i created another market field, "market2" in the database. Then i inserted a group based on the "market2" field. I placed another copy of the subreport in the original "market" header. Now, when viewing the results of the shared variable when grouped by location, i get the right result.
 
Cecil


Edited by cwhitmore - 23 Nov 2009 at 1:11pm
IP IP Logged
<< Prev Page  of 2
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.063 seconds.