Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: how to use Shared variables and supress subreport Post Reply Post New Topic
Page  of 2 Next >>
Author Message
REDBA
Newbie
Newbie


Joined: 23 Dec 2010
Location: United States
Online Status: Offline
Posts: 9
Quote REDBA Replybullet Topic: how to use Shared variables and supress subreport
    Posted: 23 Dec 2010 at 5:09am
I'm using Crystal Reports 11
I'm using shared variables in the main report only to show total amount from subreport
Is there a way to supress the subreport without changing the vlue of the shared variable?
because once I supress the subreport the value will turn to zero
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Dec 2010 at 5:13am
The sub report has to run in order to create the variable
suppress eveything in the subreport
place the sub report on its own section in the main report (above where you need to use the value)
set teh main report section that has the sub report in it to "suppress blank section"
IP IP Logged
REDBA
Newbie
Newbie


Joined: 23 Dec 2010
Location: United States
Online Status: Offline
Posts: 9
Quote REDBA Replybullet Posted: 23 Dec 2010 at 5:18am
The problem is we still using the other report(subreport) on it is own
if I suppress everything on it ... then we won't be able to use it ...
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Dec 2010 at 5:20am

I am confused. If you do not what to suppress it why are you suppressing it to cause the problem to begin with?

IP IP Logged
REDBA
Newbie
Newbie


Joined: 23 Dec 2010
Location: United States
Online Status: Offline
Posts: 9
Quote REDBA Replybullet Posted: 23 Dec 2010 at 5:27am
sorry for confusing you and thank you very much for your help
 
I meant to say in the main report we just need one variable from the subreport without showing that subreport in the main report ...
 
In the subreport itself we use it alone (by it is own)
 
what I understood from you to solve this issue (i might be wrong) is to suppress all the sections in the subreport itself ... which means if we run the subreport i won't show anyting ... just blank page
so we can not run it in it's own ...
 
Is that what you meant? please correct me if i'm wrong
 
Thank you again for your help
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Dec 2010 at 6:05am

I think you want an on demand sub report that also passes the variable.

That won't work but what you can do is have 2 versions of the sub report.
1 that suppresses all the fields but runs (as I suggested earlier) to pass the variable
the other is an on demand for viewing that does NOT pass any variable.


Edited by DBlank - 23 Dec 2010 at 6:05am
IP IP Logged
REDBA
Newbie
Newbie


Joined: 23 Dec 2010
Location: United States
Online Status: Offline
Posts: 9
Quote REDBA Replybullet Posted: 23 Dec 2010 at 10:25am
Yes ... that will do it :)
 
Thank you very much for your support ....
 
and have happy & safe holiday Clap
IP IP Logged
angelyin1984
Newbie
Newbie
Avatar

Joined: 08 May 2009
Location: Malaysia
Online Status: Offline
Posts: 30
Quote angelyin1984 Replybullet Posted: 27 Jul 2011 at 5:09pm
Helo...
 
I face the same problem too....
 
can explain more about this: (because i not understand how to do it)

I think you want an on demand sub report that also passes the variable.That won't work but what you can do is have 2 versions of the sub report.1 that suppresses all the fields but runs (as I suggested earlier) to pass the variable the other is an on demand for viewing that does NOT pass any variable.

When i suppress the subreport in the main report at detail section the value shared out from the subreport will become zero, so i don't know how to do the next.
 
Thank you
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Jul 2011 at 4:45am

suppressed subreports do not run and therefore do not return any values. That is why you get 0.

However, you can make a sr with all fields in that sr suppressed. then make the palce teh sr on its own section in the main report.
now in the main report set this section to 'suppress blank section'.
Now the subreport runs but hides all of its data, them main report sees that it ran but the section it is on is blank and hides the section but the variable still gets pulled in because the sr report had to run in order to determine the above blank conditions.
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: 29 Jul 2011 at 8:24am
easiset way is to place only the values you want to use or see in the sub,
make the color of the fields white and as small as possible,
make the sub as small as possible
but dont supress anything and make sure the variable is below the sub.
 
sharona
IP IP Logged
Page  of 2 Next >>
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.016 seconds.