Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Using formula field from subreport in main report Post Reply Post New Topic
Page  of 2 Next >>
Author Message
Kitty1
Senior Member
Senior Member
Avatar

Joined: 14 Apr 2010
Online Status: Offline
Posts: 159
Quote Kitty1 Replybullet Topic: Using formula field from subreport in main report
     Posted: 25 Aug 2011 at 6:02am

Hello,

I have formula fields in my subreports that i need to use in doing calculations in my main report, i have tried using shared variables and that returns a value of 0.00 where I know there should be figures.  Can anyone help me please ?????

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Aug 2011 at 7:06am
1. make sure the value in the main report is placed in a section below where the sub report runs.
e.g.
subreport in GH1a
main report variable in GH1b
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 7:50am

Hi D,

 
Yes I have the sub-report running first.  Any ideas why I'm not getting anything ?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Aug 2011 at 7:52am
when you run the sub report, can you you see the variable value you expect in it?
are you suppresing the sub report?
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 8:53am
yes i can see the data correctly on the subreport.  no, i'm not suppressing the subreport.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Aug 2011 at 8:55am
what is the formula you are using in them main report to display the value?
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 8:59am
whileprintingrecords;
     SHARED Numbervar  X;
     X
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Aug 2011 at 9:19am
what is the formula for the display value variable in the subreport?
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 9:31am
whileprintingrecords;
     SHARED Numbervar  X := x + {@diff arch};
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Aug 2011 at 9:44am
I am not seeing anything 'wrong' but variables are not my forte.
I would next try changing the variable name to make sure "X" is not being used somewhere else that is messing up your value in the main report.
anyone else seeing anything amiss?


Edited by DBlank - 25 Aug 2011 at 9:45am
IP IP Logged
Page  of 2 Next >>
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