0
votes

I have the report designed with following sections.

Report Header

I have added few fields to display report title and other header information followed by a sub report. I hide/show this section with a parameter value and it is working just perfect.

Page Header a

I have the header information here.

Page Header b

I have report title here. Hide/Show this section based on the parameter value

Page Header c

Fields header goes here

Group Header #1

Suppressed

Details

Detailed fields

Group Footer #1

Suppressed

Report Footer a

Blank and suppressed

Report Footer b

I have added few fields to display report title and other header information followed by a sub report.

Page Footer

Blank

I need a way to suppress Page Header a, Page Header b and Page Header c when Iā€™m printing Report Footer b. Because it has its own header. I also need to suppress the entire section of Report Footer b when the sub report is blank. Any suggestion/help greatly appreciated.

2
the content of your subreport is from a query? or from where? ā€“ Vijunav Vastivch
I have used field definition file during design. During run-time data is getting added through CrystalDataObject.CrystalComObject.AddRows from the code ā€“ Sunder

2 Answers

0
votes

In crystal report, you can do it via setting.

To suppress blank sections:

  1. Go to Report > Section Expert
  2. Highlight the section that is showing blanks (in this example, the Details section)
  3. Mark the Suppress Blank Section checkbox
  4. Click OK

https://kb.blackbaud.com/articles/Article/75439

even for subreport , if you right click on subreport, set "Suppress when blank"

Suppressing subreport with no data and a header

0
votes

I have worked out a solution from within the code. If the data rows for the crystal object is empty then

CRAXDRT.Report.Sections("RFb").Suppress = True

This solution worked for me. To suppress the main report header for the subreport section when the subreport contains data, placed a formula in the Report footer a

WhilePrintingRecords;
global booleanvar no_header := True;

In the section expert set the suppress formula as

WhilePrintingRecords;
global booleanvar no_header;
no_header

for Page Header a, Page Header b and Page Header c Thank you all for your time to respond. I really appreciate it.