Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Pass Field from Sub Report to Main Report Post Reply Post New Topic
Author Message
abauman
Newbie
Newbie


Joined: 23 Aug 2011
Location: United States
Online Status: Offline
Posts: 7
Quote abauman Replybullet Topic: Pass Field from Sub Report to Main Report
    Posted: 24 Aug 2011 at 6:16am
Pass Field from Sub Report to Main Report
 
I need to pass a field from the subreport to the main report.
 
I know how use subreport links but it wont let me actually pass the field to my main report.
 
I need to write a formula based of the subreport field in the section export of the main report to suppress details.
 
Please let me know if you have a solution.
Thanks
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 24 Aug 2011 at 7:58am
You need to look at using Global Variables, which can be used to pass data like you need to.
 
-Dell
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 24 Aug 2011 at 8:20am

SHARED VARIABLES

 

Shared variables are used to pass values from sub report to the main report.

(if you want  to summarize totals from a sub report with totals from the main report, you would use the following formulas to pass the value from the sub report to main report.

 

SUB REPORT                                        whileprintingrecords;

                                                                                SHARED Numbervar  X := x + {field};

 

MAIN                                                                     whileprintingrecords;

                                                                                SHARED Numbervar  X;

                                                                                X

 

Shared variables can not be suppressed. I make the font white and the field very small.

They must be placed below the subreport to retrieve the value.

sharona
IP IP Logged
Kitty1
Senior Member
Senior Member
Avatar

Joined: 14 Apr 2010
Online Status: Offline
Posts: 159
Quote Kitty1 Replybullet Posted: 25 Aug 2011 at 3:39am
Hello, I have the same problem.  I need to use the data from a formula in my subreport, but i need to use it in my main report.  I tried this shared variables and my data was returned as 0.00.   any ideas ?
IP IP Logged
abauman
Newbie
Newbie


Joined: 23 Aug 2011
Location: United States
Online Status: Offline
Posts: 7
Quote abauman Replybullet Posted: 25 Aug 2011 at 6:34am
STILL HAVING THE SAME PROBLEM WHY IS MY SHARED VARIABLES COMING UP ZERO???
IP IP Logged
mrstacy
Newbie
Newbie
Avatar

Joined: 04 Oct 2012
Online Status: Offline
Posts: 9
Quote mrstacy Replybullet Posted: 10 Oct 2012 at 10:53am
could be a string that wasn't converted to a number
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 10 Oct 2012 at 1:27pm
Make sure the subreport is in a section (and not suppressed) prior to the formula showing the shared value.  Also on Ken Hammady (sp?) website, he talks about having two copies of the formula that shows the shared variable, but one was before the sub-report, and the value was not updating.

I hope this helps.
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.031 seconds.