Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Shared Variable from sub-report Post Reply Post New Topic
Author Message
salemov
Newbie
Newbie


Joined: 22 Apr 2009
Online Status: Offline
Posts: 1
Quote salemov Replybullet Topic: Shared Variable from sub-report
     Posted: 22 Apr 2009 at 4:11am
Hi,
 
I'm having trouble passing a shared variable from a linked sub-report.
 
In the sub-report I am declaring the variable:
 
WhilePrintingRecords;
Shared CurrencyVar CogJan8;
If {A_LEDGERTRANS.TRANSDATE} in DateTime (2008, 01, 01, 00, 00, 00) to DateTime (2008, 01, 31, 00, 00, 00) then
Sum ({A_LEDGERTRANS.AMOUNTMST}, {A_LEDGERTRANS.TRANSDATE}, "monthly")
 
This displays fine in the sub-report but when I try to get the value on the main report:
 
whileprintingrecords;
CurrencyVar CogJan8;
CogJan8
 
The value is always £0.
 
I have tried placing the value in a sub-section down from the sub-report but it still has no value.
 
Any help appreciated Smile
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 22 Apr 2009 at 6:27am
You need to assign a value to the variable.
 
WhilePrintingRecords;
Shared CurrencyVar CogJan8;
If {A_LEDGERTRANS.TRANSDATE} in DateTime (2008, 01, 01, 00, 00, 00) to DateTime (2008, 01, 31, 00, 00, 00) then
   CogJan8:= Sum ({A_LEDGERTRANS.AMOUNTMST}, {A_LEDGERTRANS.TRANSDATE}, "monthly")
 
this should help, as now the variable CogJan8 has a value.
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