Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Passing a value from subreport to main report? Post Reply Post New Topic
Author Message
dawnh44
Groupie
Groupie


Joined: 25 Sep 2011
Online Status: Offline
Posts: 79
Quote dawnh44 Replybullet Topic: Passing a value from subreport to main report?
     Posted: 07 Mar 2012 at 8:51am
Hello everyone,
 
I've created a shared variable named shared_both.  This contains the following formula:
 
WhilePrintingRecords;
Shared NumberVar both_var := {@sum_both}
 
I have this formula in my subreport.  I'm trying to pass the value to the main report. 
 
I've created another formula in my main report named var_both.  This contains the following formula:
 
WhilePrintingRecords;
Shared NumberVar both_var
I was hoping to pass the number that is calculated in my subreport to my main report.  Does anyone have any suggestions?
 
Thank you.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Mar 2012 at 9:21am
in the main report set value
WhilePrintingRecords;
Shared NumberVar both_var;
both_var:=both_var
 
in the main report make sure you place the formula in a section below where the subreport is
e.g
GH1a subreport
GH1b @shared_both location
IP IP Logged
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