Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2007-11-14
9
Medium Priority
?
4,279 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
7 Comments
 
LVL 28

Accepted Solution

by:
bdreed35 earned 1000 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 101

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
Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

 
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 101

Assisted Solution

by:mlmcc
mlmcc earned 1000 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

772 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