Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: How to run subreport in hidden section? Post Reply Post New Topic
Author Message
kaakelitoni
Newbie
Newbie


Joined: 06 Oct 2008
Location: Finland
Online Status: Offline
Posts: 5
Quote kaakelitoni Replybullet Topic: How to run subreport in hidden section?
     Posted: 08 Oct 2008 at 6:34am
Hi,

subreport calculates some important values for shared variables. I have had to move subreport to section A and move other fields for section B, so that  the values are calculated for use of section B and its fields. There's nothing else than subreport in section A. It makes empty lines for my report, because I cannot hide section A without losing subreport executing.

How can I run subreport in hidden section to avoid empty lines?


-Toni

IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 08 Oct 2008 at 10:09am
Crystal Reports lets you suppress the section that a subreport is in and it still calls the subreport (and calculates the shared variables). However, this won't work if you Hide the section. You have to use the Supress property.
 
I have many tips and tricks about how to use subreports in CHapter 9 of my Encyclopedia book. You can find out more about my books at Amazon.com or reading the Crystal Reports eBooks online.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
kaakelitoni
Newbie
Newbie


Joined: 06 Oct 2008
Location: Finland
Online Status: Offline
Posts: 5
Quote kaakelitoni Replybullet Posted: 09 Oct 2008 at 12:42am
I have now tried to only suppress section where subreport is placed, but it doesn't work. I tried it in Crystal 8,5 and 11.5. Both the same result. Is there some settings wrong in my CR? It works again, when I unsuppress the section. Section is not hidden.

EDIT:
I got it work on Crystal 11.5, but not in 8.5. There was no suppress black subreport -option in 8.5. Thank you for your advise! Actually I have your book, but hadn't had much time to read it! :D


-Toni 

Edited by kaakelitoni - 09 Oct 2008 at 1:00am
IP IP Logged
Joco
Newbie
Newbie
Avatar

Joined: 09 Oct 2008
Location: United Kingdom
Online Status: Offline
Posts: 3
Quote Joco Replybullet Posted: 20 Oct 2008 at 9:16am
 
If you right-click on the sub-report and select Format Subreport, there is an option on the Subreport tab called 'Suppress Blank Subreport'. This should suppress the sub-report but still calculate the values. Although I'm not sure that this option is in Version 8.5. I currently use version 10 and it's available in there and I assume it'll be in 11.5 too.
 
Also, you might want to put your subreport in it's own section and make it as small as possible, then it won't take up any space if there is nothing in it. If there is anything to print then the sub-report will grow (as long as you tick the 'Can Grow' option in the Common tab). 
 
Kind Regards,
Jo.
 
p.s. I always add an extra suppressed section above the sub-report with a comment in (e.g. sub-report in section below), so next time I remember it's there


Edited by Joco - 20 Oct 2008 at 9:20am
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