Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Supress detail and group when subreports are blank Post Reply Post New Topic
Author Message
rqs2344
Newbie
Newbie
Avatar

Joined: 12 Dec 2008
Location: United States
Online Status: Offline
Posts: 3
Quote rqs2344 Replybullet Topic: Supress detail and group when subreports are blank
     Posted: 12 Dec 2008 at 11:29am
The question : Is there a way to suppress the detail section and group of a report if the subreports contained in the detail section are blank?

Here are the specifics on the report: The main report pulls student information, each student has a unique id number. The report is grouped first by school[GH1] then by grade[GH2] and finally by a formula that creates a unique string by concatenating their last and first names with their internal database id #[GH3].
Within the detail section of this report there are two subreports both of which are linked to the main report by the students internal database id.
The first one pulls discipline log entry items for the student who is listed in GH3.
The second subreport pulls course information for all courses the student in GH3 is failing.

I would like for GH3 and detail to be suppressed if both of the subreports are blank. Due to the order of evaluation, I can't pass a variable to use in a formula in the section expert because the GH3 is already processed by the time that the subreport is gotten to.

I appreciate any ideas that you folks have, on how to accomplish this. Thanks. Smile
Timothy


Edited by rqs2344 - 12 Dec 2008 at 11:34am
Timothy
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 13 Dec 2008 at 1:11am
Hi
 
Right Click Subreport then format subreport then in subreport tab select Suppress Blank Subreport.
 
Once done go to Report Section Expert then Select Details Section IN Common Tab Check Suppress Blank Section do the same for Group Header
 
Crystal Version XI
Cheers
Rahul
IP IP Logged
rqs2344
Newbie
Newbie
Avatar

Joined: 12 Dec 2008
Location: United States
Online Status: Offline
Posts: 3
Quote rqs2344 Replybullet Posted: 15 Dec 2008 at 6:24am
I have actually already tried that. The problem is that the GH3 section is never blank, there will always be a student name in it, so telling it to suppress it when blank won't work. If, however, the two subreports in the detail section for that particular student are blank I don't want that student to show up on the report. I really appreciate the input and if you have any other ideas please let me know. 
Timothy
IP IP Logged
theBlueFrog
Newbie
Newbie
Avatar

Joined: 22 Apr 2008
Online Status: Offline
Posts: 8
Quote theBlueFrog Replybullet Posted: 15 Dec 2008 at 8:00am
Hi Timothy,

How are your SQL skills?

I would recommend that you create an SQL view with all of the information from the main report that you need.... + a bit (1 or 0) field value which is based upon whether the student has any disciplinary records, and the same again for if the student is marked as failing any courses.

You then end up with, alongside each student record, 2 fields that can contain either a 1 or a 0.  If both are 0 then you suppress GH3 and the Details section.

I don't have time to go into the full detail of the SQL that you need, but you are looking for a TOP (1) statement in your SQL to query your Disciplinary records, the outcome of the statement is a 1 if a record exists, a 0 if not.

Same for the failing courses records.

Hopefully that points you in the right direction if you are comfortable with creating an SQL view.
Anton Wilson
Microsoft CRM Consultant &
Crystal Reports specialist
IP IP Logged
rqs2344
Newbie
Newbie
Avatar

Joined: 12 Dec 2008
Location: United States
Online Status: Offline
Posts: 3
Quote rqs2344 Replybullet Posted: 15 Dec 2008 at 9:20am
I am pretty good with PL/SQL, I am just not sure that I can create a view. The vendor for the software package that I am trying to report out of (PowerSchool) has a lot of restrictions on what they allow their customers to can do in the DB. I will definitely look into it and see if I have sufficient rights to create a view. Good idea. Thanks for the input.
Timothy
Timothy
IP IP Logged
theBlueFrog
Newbie
Newbie
Avatar

Joined: 22 Apr 2008
Online Status: Offline
Posts: 8
Quote theBlueFrog Replybullet Posted: 15 Dec 2008 at 9:50am
Timothy,

That restriction is very similar to what we have in Microsoft CRM land.  What we do there, is create another database for any views, stored procedures etc. that we create, and those views / procs refer back to the main app database. 

Then all we're doing is reading data from the App's database, but can still manipulate the data as required for our reports / custom code.


Edited by theBlueFrog - 15 Dec 2008 at 9:51am
Anton Wilson
Microsoft CRM Consultant &
Crystal Reports specialist
IP IP Logged
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