Chandanan
Chandanan

Reputation: 101

Supressing empty Subreports in Crystal report

Problem: I want to suppress the DetailsSection 4 and 5 if there are no records in Subreports in them.So the problem is that I can supress them if they are no rows in the table of that subreport. but when there are rows , I see that the report is so big and repeating itself many times. I can see the report with all the sections repeating again and again when there is data.

I have a Crystal report with 5 Subreports as follows.

  1. reportHeader
  2. PageHeader
  3. DetailsSection1(Subreport1 Here)
  4. DetailsSection2(Subreport2 Here)
  5. DetailsSection3(Subreport3 Here)
  6. DetailsSection4(ApplicantInformation Here)
  7. DetailsSection5(CBInformation Here)
  8. PageFooter
  9. ReportFooter

The steps I followed are :

Step:1 (Collected the total records of table ApplicantInformation in this shared var)

Create a shared Variable AppInfoCount with the following content in the formula

WhilePrintingRecords;
Shared NumberVar AppCount;
AppCount := count({ApplicantInformation.DirectionID});
""

Step 2 :Used this variable for suppressing the detailsection4 in the Main report.

So In the Section Expert-->DetailSection4--> 
under Supress(No Drill-down)(x-2) I gave the formula 
WhilePrintingRecords;
Shared NumberVar AppCount;
if( AppCount= 0 ) then True else false;

I did all this in the Main report and not sub report. Is there something that I am missing? please help and thanks for those active helpers.

Regards, Chandanan.

Upvotes: 1

Views: 885

Answers (1)

Conrad Frix
Conrad Frix

Reputation: 52675

Rather than create detail sections for the ApplicantInformation and CBInformation sub reports create two more report footer sections. And put the sub reports there

Upvotes: 1

Related Questions