Print Page | Close Window

Shared Variables from Multiple Subreports

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=9033
Printed Date: 03 May 2024 at 12:40am


Topic: Shared Variables from Multiple Subreports
Posted By: maverix
Subject: Shared Variables from Multiple Subreports
Date Posted: 03 Feb 2010 at 12:39pm
I have three subreports in a report. Each subreport has a shared variable through which it returns a value to the main report. The subreports are in a group header, and the group footer reads these variables and displays them.

Now, this works fine when the subreports are in separate sections. However, if I place these subreports in the same section, I notice this behavior:
 - If all three subreports start and end on the same page, the values are passed correctly.
 - But if the subreports are longer and extend across more than one page, only the longest subreport returns a value through its shared variable. The other two subreports do not modify their shared variables.

All functions that access the shared variables start with a WhilePrintingRecords, and each subreport has its own shared variable. My question is why does it behave this way and how can I fix it?





Print Page | Close Window