Print Page | Close Window

Suppressing Problem

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1190
Printed Date: 07 May 2024 at 1:58am


Topic: Suppressing Problem
Posted By: Dreamcatcher
Subject: Suppressing Problem
Date 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???  



Replies:
Posted By: jkwrpc
Date 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.
http://www.CustomReportWriters.net - www.CustomReportWriters.net


Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: jkwrpc
Date 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.
http://www.CustomReportWriters.net - www.CustomReportWriters.net


Posted By: Dreamcatcher
Date 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.


Posted By: yggdrasil
Date 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


Posted By: BrianBischof
Date 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.


-------------
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>


Posted By: yggdrasil
Date Posted: 22 Aug 2007 at 7:15am
Thanks a million Brian, that certainly worked for me.Star


Posted By: Dreamcatcher
Date 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?


Posted By: BrianBischof
Date 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>


Posted By: Dreamcatcher
Date Posted: 24 Aug 2007 at 12:47am

Ok, thanks for all your help Brian.




Print Page | Close Window