Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: suppress sub-report when detail count is 0 Post Reply Post New Topic
Author Message
procto73
Newbie
Newbie
Avatar

Joined: 12 Nov 2012
Location: United States
Online Status: Offline
Posts: 3
Quote procto73 Replybullet Topic: suppress sub-report when detail count is 0
    Posted: 08 Mar 2013 at 11:53am
Using Crystal XI
I have a specific formatted sub-report, upon calling the sub-report I print specific header information and at the end of the report is specific foot information; neither have anything to do with the detail. While reading thru the detail records (those that meet the match criteria from the main report; ie. customer, addressID matches), I also suppress any detail on the sub-report that has a specific value in a field on the detail. So, I may have 20 detail records that could be printed because they match the sub-report selection criteria but they are suppressed because they have a value in a field that I don't want that detail record to be printed. My problem is that when no detail is actually printed I don't want any of the sub-report to print. As it is now I get the header and footer info without any detail; what I want is the whole sub-report suppressed if no detail at all is printed. The sub-report works fine if at least 1 record is printed.

How can I accomplish this because the sub-report is not blank at this point so suppressing on blank is not working?
KP
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Mar 2013 at 12:02pm
if i understand you, all of this is in the sub report.
You are suppressing detail based on a criteria.
if this criteria is basedo only on data int hat row, create a formula to give a value for 1 if not suppressed and 0 if suppressed
sum that at teh report level
if it is 0 all rows are suppresses so you can suppress the header and footer sections based on that
sum(formula)=0
this in turn makes the sub report "blank"
which allows you to supress the sub report in the main report on that condition
IP IP Logged
procto73
Newbie
Newbie
Avatar

Joined: 12 Nov 2012
Location: United States
Online Status: Offline
Posts: 3
Quote procto73 Replybullet Posted: 10 Mar 2013 at 8:30am
Thanks, that did it. I had the counter for the number of records but was trying to pass back to main report to suppress and that did not work. By checking it as you suggested in the sub report worked fine. Thanks for your help!
KP
IP IP Logged
procto73
Newbie
Newbie
Avatar

Joined: 12 Nov 2012
Location: United States
Online Status: Offline
Posts: 3
Quote procto73 Replybullet Posted: 11 Mar 2013 at 3:43am
Ok, have one more issue. Along the same lines, this subreport has a group header that prints at the beginning of the report. It also have a report footer that prints on the last page. It can get 11 detail lines on a page and print a footer if there are only 11 detail records. If there are more than 11, it will print a max of 12 on the page (page overflow) and then go to the next page. On the next page if there is more detail to print it will also print the group header, but if there is no more detail that meets the criteria it only prints the report footer and I need it to also print the group header. How can I accomplish this?
KP
IP IP Logged
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.