C# – Programmatically hide text/lines in a Crystal Report

ccrystal-reports

I have a Crystal Report that I populate before displaying to the user using a CrystalReportViewer.

I have some static text items and line segments that I would like to show and hide programatically depending on conditions in the business logic. Is there a way I can group a bunch of these items together and hide them as a group?

At the moment, my other option is to have two separate reports that are identical except for these superficial differences.

Best Answer

By all means, please don't create two separate reports :)

In the Report Design view, you should be able to create sub-sections of your detail section (assuming you're talking about the detail section), right-clicking on the Detail section and selecting "Insert Section Below".

You should now have "Details a" and "Details b" sections. You can put your text in the "Details b" section, and apply a conditional suppression formula to it.

To conditionally suppress the "Details b" section, right-click on it in the Design View, select "Format section...", click on the button next to the "Suppress" checkbox, and add your formula there.

Related Topic