Programmatically hide text / lines in Crystal Report

I have a Crystal report that I fill out before displaying to the user using CrystalReportViewer .

I have some static text elements and line segments that I would like to show and hide programmatically depending on the conditions in the business logic. Is there a way to combine a bunch of these elements 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.

+6
source share
2 answers

In any case, do not create two separate reports :)

In the "Report Design" view, you should be able to create subsections of your details section (provided that you are talking about the details section) by right-clicking on the "Details" section and selecting "Insert Section Below."

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

To conditionally disable the "Details b" section, right-click it in the "Design" view, select "Section Format ...", click the button next to "Suppress" and add your own formula there.

+5
source

Follow these steps:

1-Add a required field to the report canvas

2-Right-click on the field

3 - select the menu item "Field format"

4 - On the General tab in the Format Editor dialog box, click the Conditional Format button [x + 2] for the Display Bar option

5-In the Formula Workshop, enter the following formula:

  if {Tablename.Fieldname}= True then Totext(CurrentFieldValue) else Totext((CurrentFieldValue)) + " Outstanding" 

6 - Click the [Save and Close] button

7 - Click the OK button in the Format Editor dialog box

0
source

All Articles