Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Suppressing Problem Post Reply Post New Topic
Page  of 2 Next >>
Author Message
Dreamcatcher
Newbie
Newbie
Avatar

Joined: 14 Aug 2007
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote Dreamcatcher Replybullet Topic: Suppressing Problem
    Posted: 17 Aug 2007 at 4:09am

Hi, I'm using a supreport to calc a count against some records and am using a Shared Numbervar to bring the result back into the main report.

The supreport is placed in the details section of the main report and i have record details coming out in the footer. The footer is suppressed dependant on results of the variable count. (Suppress if COUNT > 0)
 
All works fine until i try to suppress or hide the details section of the main report??? (Which i obviously dont want to print out).
When i do this the variable count stays at 0 and every record is then displayed.
 
Any ideas???  
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 17 Aug 2007 at 9:32am
Just a thought try setting the formula to ' = 0'  If the count is 0 then the formula would be true which is what is needed to Suppress.
 
Hope this helps
 
Regards,
 
John W.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 17 Aug 2007 at 2:00pm
If you suppress the section where the subreport is located, the subreport will not run. 
 
To get around this, I think you can setup the subreport so that all of the shared variables are in the report footer, overlapped so that they don't take up much space, and with the text color set to whatever your background color is (usually white).  Suppress all other sections.  Turn off the borders on the subreport object in your main report make the subreport very small and place it in the footer of your inner-most group.
 
-Dell
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 18 Aug 2007 at 7:00am
After reading Dell's response, I realized in my haste I had entirely misread the question, and gave an entirely incorrect answer. My apologies to you and thanks to Dell for the more thoughtful response.
 
Regards,
 
John W.
IP IP Logged
Dreamcatcher
Newbie
Newbie
Avatar

Joined: 14 Aug 2007
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote Dreamcatcher Replybullet Posted: 21 Aug 2007 at 2:26am
Hi Hilfy,
 
Thanks for the info. I had done most of what you said but still have a small problem. My inner most footer section on the main report is being suppressed if shared variable > 0, which works fine if i place the subreport in the details section on main report. Only porb is that i get lots of spaces even if i make as small as possable.
If i place subreport in inner most footer of main report, although the shared variable counts proberly in subreport, when i output the variable again in the inner most footer of main report the shared variable returns 0. (As its now in same section as supreport). Hence no records get suppressed.
Tried adding another footer section but to no avail.
 
Ant ideas would be greatly recieved.
IP IP Logged
yggdrasil
Senior Member
Senior Member
Avatar

Joined: 19 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 150
Quote yggdrasil Replybullet Posted: 21 Aug 2007 at 5:29am
I'd love to be able to help, but I have exactly the same problem with one of my reports. The subreport calculates per group, and there are some 300 occurrences of the group, which makes for an awful lot of blank spaceCry
So I will keep watching this thread in case someone somewhere comes up with an answer
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 21 Aug 2007 at 8:49am
I have a couple thoughts, but it seems like you guys already tried them? First off, subreports are always calculated last in a section. So they will always return zero in the section they are printed in. No way around that. Now, Dreamcatcher said that he created a second footer section and put the subreport there. I'm assuming you put the subreport, and ONLY THE SUBREPORT, in Footer Section A? Always keep the subreport in its own section with nothing else in it. If you put it in section B then it will be called last and not work for you.

Now, if you did all that and it doesn't work (which is should work, but maybe something else is going wrong...) then you can put the subreport in the Detail section and suppress it. I wrote about how to do this in Tutorial 9-6  of my CR Encylopedia book.

1. After making sure that the subreport formula works (and you get tons of blank space), add it to ITS OWN SECTION (very important) in the main report.

2. Then go into the subreport and set EVERY section to be Suppressed. This disables printing the sections but the formulas will still be calculated. Test to make sure it is blank.

3. Then on the main report right-click on the subreport and select Format Subreport. Click on the Subreport tab and click the option Suppress Blank Subreport. This hides the subreport when every section is suppressed. Save your changes.

4. On the main report, right-click on the gray area to the left of the section that has the subreport and choose Section Expert. Click the option Suppress Blank Section. Save your changes. This will keep the subreport from printing, but its calculations are still run.

That should do it! I tested this pretty well prior to writing about it and it works like a charm.


Edited by BrianBischof - 21 Aug 2007 at 8:51am
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
yggdrasil
Senior Member
Senior Member
Avatar

Joined: 19 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 150
Quote yggdrasil Replybullet Posted: 22 Aug 2007 at 7:15am
Thanks a million Brian, that certainly worked for me.Star
IP IP Logged
Dreamcatcher
Newbie
Newbie
Avatar

Joined: 14 Aug 2007
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote Dreamcatcher Replybullet Posted: 23 Aug 2007 at 6:57am

I put the supreport in the first footer and then the details i wanted printed out in the second footer. This worked fine except i had the same problem with lots of spaces as i couldn't suppress the section containing the subreport.

Really appreciate your notes but i'm actually using Crystal 8 and seems i dont have 'Suppress Blank Subreport' option you descibed in point 3???? or at least i cant see it.
 
Apart from upgrading my crystal,  any ideas?
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 23 Aug 2007 at 12:00pm
Oh. Yes, CR 8 doesn't have this feature. I think they added it around CR 10. The only option is to make the subreport object on the main report really small. 
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
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.031 seconds.