Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Share Subreport Variable and DrillDown Post Reply Post New Topic
Author Message
RonK
Newbie
Newbie


Joined: 14 Aug 2009
Location: Netherlands
Online Status: Offline
Posts: 7
Quote RonK Replybullet Topic: Share Subreport Variable and DrillDown
     Posted: 14 Aug 2009 at 3:56am
I have created a report with two subreports at detail level. Both subreports set a shared variable I use these variables on total level in the main report. It all works well untill I try to hide (drill down - ok) the detail section. The shared variables at total level become zero. Confused
 
How can I solve this? I assume Crystal does not 'run' the subreports anymore because they are hidden. Is there a way to force Crystal to perform the subreports? Question
 
Thanks for any help,
Ron
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 14 Aug 2009 at 6:15am
This was actually someone just posted something about this in last month or so, so I have something for you try.
 
Each subreport needs to be in its own section, all by itself, and then things should work as expected.
 
Give it a try.  I haven't tested this as I very rarely use subreports.
 
HTH
IP IP Logged
RonK
Newbie
Newbie


Joined: 14 Aug 2009
Location: Netherlands
Online Status: Offline
Posts: 7
Quote RonK Replybullet Posted: 14 Aug 2009 at 6:41am
Thanks for the quick response.
I have tried it right away, but it did not work.
 
I created an extra details section, so I got Da and Db.
Then I made sure I had just one subreport per detail section.
Sofar everything was fine, but once I selected "Hide (drill down ok)".
Not only my details were gone, but also my shared variable values. Unhappy
 
Searching the net I found another suggestion:
Make the subreport suppress all sections, which works fine.
And then set "Suppress  Blank Section" in the main report.
But that does not supress the sections so I endup with a lot of blank lines. Don't know why, it works with other sections, but not here ... Cry
 
Thanks for the help ...
Still searching for a solution.
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Aug 2009 at 8:44am

You have to suppress them in a unique way.

Suppress all of the fields in the sub report.
Go into the main report
Right click on the sub report and select Format SubReport.
On the Common tab make sure Suppress is NOT checked.
go the SubReport Tab and check Suppress Blank Subreport
Now go to the section expert and suppress blank section (make sure all other suppress options are not checked).
basically you have to make the report run to verify everything is blank which generates the variable to be passed and then eventually suppresses the report as well. If you just flat suppress it it will not run at all so no variable exists to return.
Make sense?


Edited by DBlank - 14 Aug 2009 at 8:46am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 14 Aug 2009 at 12:08pm

I don't use subreports, sorry I missed a few details.

 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Aug 2009 at 12:14pm
I hope I got it right (because as you know I don't use variables, or at least not well)  Wink
IP IP Logged
RonK
Newbie
Newbie


Joined: 14 Aug 2009
Location: Netherlands
Online Status: Offline
Posts: 7
Quote RonK Replybullet Posted: 16 Aug 2009 at 3:07am
Hi DBlank, (and all others)
 
Yes it does all make sense. I did as you described. The shared variables did get / keep the intended values and the sub reports were blank, but the "Suppress Blank Section" did not work.
 
So I started to try other 'changes'. Once I disabled the "can grow" on the common tab for these sub reports ... it worked! Approve Although I'm not sure that's there real reason.
 
But when going on editing my report ... the blank lines suddenly reappeared! Disapprove I still don't know what precisely caused this.  Wacko The only thing I could do was go back to a prior version (I do make a lot of back-ups under these circumstances Wink)
 
So although I could make it work. It still puzzles me.
 
Thanks everybody for your help.
And new suggestions are still welcome. Thumbs%20Up
 
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