cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically Suppressing Report Sections?

Former Member
0 Kudos

Can someone please tell me if there is a way to suppress sections of a report at runtime? I am giving the user the option to output to excel or pdf. If excel, I want to suppress the page headers and footers so I donu2019t end up with a bunch of blank rows for every page break. Can this be done or do I need to create two nearly identically reports to accomplish this? Thanks!

Version u2013 vs2003, C#

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello, Dan;

You can do a conditional suppression on sections in the designer based on a parameter you pass in at runtime.

If {?SuppressSection} = "View" Then

False

Else If {?SuppressSection} = "Suppress" then

True

Then from your application pass in "View" or "Suppress" depending on if you are viewing or exporting the report.

'Pass the parameter Name and parameter Value

crReportDocument.SetParameterValue("SuppressSection", "View")

Elaine

Former Member
0 Kudos

Very nice. Thanks again Elaine!

Answers (0)