Thanushka
Thanushka

Reputation: 1445

Crystal Reports make text box visible true false

I need to make a text box visible true, false based on the value of a Boolean type column in the data set. How can I do that?

Upvotes: 5

Views: 32069

Answers (3)

Thin July
Thin July

Reputation: 76

Thanks Justin & Thanushka!

  1. Right click on field and select 'Format Object'.

  2. On the 'Common' tab select the formula editor button to the right of the 'Suppress' label.Click the suppress check box and then click the formula editor button.

  3. To be visible set formula to: {Field} = 'true'

  4. To be hidden set formula to: {Field}= 'false'

Upvotes: 1

craig
craig

Reputation: 26272

You may also want to consider the CurrentFieldValue keyword. By using CurrentFieldValue instead of the actual field name, is it easy to copy the formatting between similar fields using the Format Painter.

In your situation, the suppression formula would be

CurrentFieldValue=True

A neat trick to turn a Boolean value to Yes/No is to make use of the field's Display String property; it is also located on the Common tab. Enter the following formula:

IIf(CurrentFieldValue=True, 'Yes', 'No')

Upvotes: 0

Justin
Justin

Reputation: 2103

-Right click on field and select 'Format Object'.

-On the 'Common' tab select the formula editor button to the right of the 'Suppress' label.Click the suppress check box and then click the formula editor button.

-For true to be visible set formula to '{Field} = true'

-For true to be hidden set formula to '{Field}=false'

Upvotes: 12

Related Questions