Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically hide text/lines in a Crystal Report

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.

like image 827
Charlie Salts Avatar asked Oct 31 '12 19:10

Charlie Salts


People also ask

How do you hide a line in Crystal Reports?

Right-click on the text box and select Format Text. On the Common tab, mark the Suppress Embedded Field Blank Lines checkbox. Click OK.

How do I hide labels in Crystal Reports?

To set the suppress option you have to right click on the item which you want to suppress (with condition) and choose Format Object . There you choose the Common tab and enable the option Suppress . On the right side you can open the Formula Workshop of the Suppress option. There you have to insert the condition ( {?


1 Answers

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.

like image 57
LittleBobbyTables - Au Revoir Avatar answered Oct 20 '22 15:10

LittleBobbyTables - Au Revoir