cancel
Showing results for 
Search instead for 
Did you mean: 

How to suppress both groupheader and groupfooter?

Former Member
0 Kudos

Hi,

my requirement is to suppress the no data groupheader and its groupfooter. Please help me on this.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member203619
Contributor
0 Kudos

There are two options that I can see:

1. Use a formula to suppress. Just go into the section expert and change the formula for the "Suppress" option on the group header and footer to something similar to:

if isnull(count({Customer.Customer ID})) then true else false;

2. Suppress the sections via code. This sample suppresses the page header.


Section oSection = (Section)oReportClientDocument.getReportDefController().getReportDefinition().getPageHeaderArea().getSections().getSection(0);

// copy the format object as per the Model/View/Controller architecture 
// and make the modifications to the copy of the format object.
ISectionFormat oSectionFormat = new SectionFormat(oSection.getFormat());
oSectionFormat.setEnableSuppress(true);
	
// Commit the changes back to the ReportClientDocument object using the
// ReportSectionController.
oReportClientDocument.getReportDefController().getReportSectionController().setProperty(
oSection, ReportSectionPropertyEnum.format, oSectionFormat);

Shawn

Former Member
0 Kudos

Shawn,

Actually my requirement is to suppress the blank row (i.e) suppress the groupHeader which is blank and its corresponding groupFooter.

This is my code snippet for suppressing the groupheader,

ISectionFormat sectionFormat = groupHeader.getFormat();

//iSectionFormat.setEnableSuppress(true);

sectionFormat.setEnableSuppressIfBlank(true);

clientDoc.getReportDefController().getReportSectionController().setProperty(groupHeader,ReportSectionPropertyEnum.format, sectionFormat);

This is my code snippet for suppressing the groupFooter,

ISectionFormat iSectionFormat = groupFooter.getFormat();

iSectionFormat.setEnableSuppressIfBlank(true);

// Set the Properties of the Section through the ReportSectionController by passing in the original section you wish to modify,

// the type of propery you wish to set (ReportSectionProperyEnum.format), and the modified section property

clientDoc.getReportDefController().getReportSectionController().setProperty(groupFooter,ReportSectionPropertyEnum.format, iSectionFormat);

Now coming to my problem, as per the above code my guess is blank data groupHeader and its groupfooter should suppress, but groupHeader alone gets suppressed, but what i want is to suppress the groupFooter too..

Thanks,

Sureshkumar Durairaj

ted_ueda
Employee
Employee
0 Kudos

You want to suppress a Group section if there's no data - have you tried asking on Business Objects -> Crystal Reports Design?

Sincerely,

Ted Ueda

Former Member
0 Kudos

Ted,

This is not static report, this is customizable report via java coding.

I tried to paste a sample screen shot of the problem, but i was not able to paste or attach.

Please advice.

Thanks,

Sureshkumar Durairaj

ted_ueda
Employee
Employee
0 Kudos

You can customize a Crystal Report - specifically whether a section is suppressed or not - via Crystal Report functions. I'd recommend that - using the Designer - than trying to introspect the report via the SDK.

Which SDK and version would you be using by the way?

Sincerely,

Ted Ueda

Former Member
0 Kudos

Ted,

I am using Report Application Server Java SDK.

Thanks,

Sureshkumar Durairaj