Print Page | Close Window

Sharing variables between subreports

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=39
Printed Date: 30 Apr 2024 at 2:38pm


Topic: Sharing variables between subreports
Posted By: mxr561
Subject: Sharing variables between subreports
Date 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



Replies:
Posted By: BrianBischof
Date 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).



Print Page | Close Window