Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Sharing variables between subreports Post Reply Post New Topic
Author Message
mxr561
Newbie
Newbie


Joined: 06 Dec 2006
Location: United States
Online Status: Offline
Posts: 13
Quote mxr561 Replybullet Topic: Sharing variables between subreports
    Posted: 06 Dec 2006 at 8:22am
The report I'm working on has some 15+ subreports. Each subreport with a different Stored proc as a data source. I have to create a summary page at the beginning of the main report which summarizes data from all of these subreports that are to follow.

For this, if I create a shared variable in the very first subreport (which will be the summary) and have all the other subreports populate this variable, will it work? Is there a way to set the very first subreport to draw at the end even though it is present at the beginning?

thanks
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 06 Dec 2006 at 1:41pm
Putting all the summary data on the first page doesn't work. It's the same problem people have with creating a table of contents: you can't print something that hasn't been determined yet. CR works sequentially, page by page. If you have multiple sub-reports in a row, they are worked on in sequence. The last one will be able to get data from the first one, but not the other way around.

A way around this is to create a stored procedure which calculates the values you need for the summaries and call them in the beginning. Just make sure you return the summary data and not all the detail records (which wastes too much bandwidth).
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.063 seconds.