Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Suppress a Text Field Post Reply Post New Topic
Author Message
yeller
Newbie
Newbie
Avatar

Joined: 06 Feb 2014
Online Status: Offline
Posts: 12
Quote yeller Replybullet Topic: Suppress a Text Field
     Posted: 07 Feb 2014 at 5:26am
Within a details section, I would like to suppress a text field if the contents of a table within the same section is not of a certain type.

It appears that the place to save the formula would be in format text? Then use the suppress formula editor? Would somebody be willing to help with a formula to do this?

Thank you.

Example: suppress if text field is not like {yellow_stuff.Type} = "R"
IP IP Logged
hello
Groupie
Groupie
Avatar

Joined: 05 Feb 2014
Online Status: Offline
Posts: 85
Quote hello Replybullet Posted: 07 Feb 2014 at 9:49am
What about placing spaces in the text box if a certain condition is met?

If {table.text_field} = "R"
Then {table.text_field} = "R"
Else {table.text_field} = "    "

I am thinking that would be placed in the Section Expert for the details section.

I usually place a formula there to create a mainframe type report look with alternating shades:

If recordnumber mod 2 = 0 then crsilver else crnocolor
IP IP Logged
yeller
Newbie
Newbie
Avatar

Joined: 06 Feb 2014
Online Status: Offline
Posts: 12
Quote yeller Replybullet Posted: 07 Feb 2014 at 10:33am
Hi, Thank you for responding. The text box is a "Text Object". I'm not seeing it listed anywhere as a report field.
IP IP Logged
hello
Groupie
Groupie
Avatar

Joined: 05 Feb 2014
Online Status: Offline
Posts: 85
Quote hello Replybullet Posted: 10 Feb 2014 at 4:00am
You could make a formula field to represent that text object. Then your formula would look something like this:

stringvar text_box;

If {table.text} = "R"
Then text_box = "R"
Else text_box = "    ";

text_box;

Edited by hello - 10 Feb 2014 at 4:06am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Feb 2014 at 4:29am
IMO
Right click on the text box
select Common tab
select the formula  (x-2) next to Suppress
add your boolan result formula here, if it returns TRUE is suppresses
{yellow_stuff.Type} <> "R"
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum