Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Shared Variable values across the report Post Reply Post New Topic
Author Message
cheenu_vasan
Newbie
Newbie
Avatar

Joined: 06 Apr 2011
Location: India
Online Status: Offline
Posts: 16
Quote cheenu_vasan Replybullet Topic: Shared Variable values across the report
     Posted: 17 Dec 2012 at 5:46am
I have created a shared numbervar variable in the report header section with value zero initialized in a formula.

shared numbervar test:=0; (Report header section)

Then i assign some intermediate values in one of the sub report in details section of main report using the formula:

shared numbervar test:=350; (Inside sub report in the details section of the main report)

Then in bottom of the main report say in another details section, i tried to access the variable using another formula:

shared numbervar test;
test;

But the result is always shows as zero, the intermediate values are not  retrieved at the end of the report.
Let me know what i have missed or doing not right here...?
Thanks & Regards
Srinivasan B
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 17 Dec 2012 at 8:08am
Is the sub-report or section that the sub-report is contained suppressed?  If so, the sub-report will not execute.  Otherwise, I can only suspect that you are using the shared numbervar test somewhere else that it is getting reset to zero.  I would put the formula

shared numbervar test;
test;

in a section immediately after the subreport section (another detail section?) and see it the value is there.

I hope this helps.


Edited by kevlray - 17 Dec 2012 at 8:09am
IP IP Logged
cheenu_vasan
Newbie
Newbie
Avatar

Joined: 06 Apr 2011
Location: India
Online Status: Offline
Posts: 16
Quote cheenu_vasan Replybullet Posted: 17 Dec 2012 at 11:19pm
yes i have some condition in the suppress (that contains the sub report) @ which it doesn't need to show in the report.

So i see there is no way to retrieve the values in such scenario..?
Thanks & Regards
Srinivasan B
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 18 Dec 2012 at 6:22am
You have to do other tricks.  One idea(got the idea from Ken Hammady), do not have any fields in the subreport, then have it 'suppressed when blank' (I think that is the proper wording).  Make the section with the subreport real small.

I know there may be other ways, can't remember them right now.
IP IP Logged
cheenu_vasan
Newbie
Newbie
Avatar

Joined: 06 Apr 2011
Location: India
Online Status: Offline
Posts: 16
Quote cheenu_vasan Replybullet Posted: 18 Dec 2012 at 7:47am
Ok.. will play around. I cannot avoid the fields in the sub report since those are the details that should be in there.

One thing in want to confirm, are you saying replace all the db fields to formula and set its suppress field as necessary??

Meanwhile if anybody hv suggestion it is appreciated. Thanks in advance.


Edited by cheenu_vasan - 18 Dec 2012 at 8:08am
Thanks & Regards
Srinivasan B
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 18 Dec 2012 at 9:34am
What I was saying that if you wanted the sub-report to execute, but not see it was to suppress, not display the fields in the sub-report.  Then for the properties of the sub-report, have it suppress if empty.  I do not know if that would work for you.
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