Solved

Hide Main section in Crystal report if the Sub Reports are empty

Posted on 2007-11-14
9
4,271 Views
Last Modified: 2008-03-10
I would like to know how to hide the main section in a report based on the sub reports not having any data to display.
0
Comment
Question by:iaintarr
9 Comments
 
LVL 28

Accepted Solution

by:
bdreed35 earned 250 total points
ID: 20280387
Are you talking about the section that the subreport is in in the main report?
If so, you need to set 2 things.
First, right click the subreport and choose Format Subreport in the popup.
Click the Subreport tab, then set the property "Suppress Blank Subreport", then click ok.
Second, go into the Section Expert in the Main report, click on the section name that the subreport lives in, and set the property "Suppress Blank Section"
Test.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 20280464
That works if the main section is empty.

You need to get the result from the subreport before the section you need to suppress otherwise the section has already started to display and can't be suppressed except in the case of suppressing a blank section.

Is there a query that will determine if the subreport will be empty?

mlmcc
0
 
LVL 1

Author Comment

by:iaintarr
ID: 20280476
No. I am talking about the main detail section in the main report, this section has two sub report detail sections, each with a sub report in them.
I can suppress the subreport detail sections if they do not contain data, but if both sub reports are supressed due to not having data in them, i would like the main detail section, which they fall under, in the main report to be suppressed.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:iaintarr
ID: 20280489
mlmcc, the query is the one way i have done it, but would rather have less of a noose around the queries neck.
Was just wondering if there is indeed a way to supress the main section based on the sub reports
0
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 250 total points
ID: 20280601
As far as I know we have given you the 2 ways.  Is there information in the detail section before the subreport?

If not you may be able to have multiple detail sections.
Put the subreprots in the first detail section then based on a shared variable that returns whether there was data in the subreport and supress the subdetail section based on that.

mlmcc
0
 
LVL 1

Author Comment

by:iaintarr
ID: 20280628
i shall do the shared variable approach, see what happens.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20592587
Forced accept.

Computer101
EE Admin
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now