Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Suppressing TextBox based on Data Fields Post Reply Post New Topic
Author Message
Mike Hoyt
Newbie
Newbie


Joined: 19 Mar 2013
Online Status: Offline
Posts: 5
Quote Mike Hoyt Replybullet Topic: Suppressing TextBox based on Data Fields
    Posted: 19 Mar 2013 at 8:30am
I have a DataField and an associated TextBox Object with name of "Label" which serves as a label for the DataField.  When the DataField's value is NULL, that field is automatically suppressed on the report.  What I want to do is set up a conditional format on the TextBox so it will also be suppressed if the DataField is NULL.

I've gone into the TextBox Formats and selected the Formula Editor next to Suppress.  I enter the following

IsNull {DataField}

But this has no effect on the TextBox.  I also tried

If IsNull{DataField}
Then {Label}

but I get the error that {Label} is not a field.  Which is true, it's an object.

How do I suppress an object based on some other field being NULL?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Mar 2013 at 8:39am
are you referencing labels that are inserted in page or group headers when you insert a field into the detail section?
IP IP Logged
Mike Hoyt
Newbie
Newbie


Joined: 19 Mar 2013
Online Status: Offline
Posts: 5
Quote Mike Hoyt Replybullet Posted: 19 Mar 2013 at 8:45am
Both the DataField and TextBox are in the Detail section.

It might help to understand my Data Source. I'm building a Report Card. The report Card for every student must contain the exact same set of fields, but because not every student gets graded on every item I can't do something simple like

Student Subject Grade

and let CR just fill in as many rows as required for each student.

Instead, my data source has every possible field ofr every student.  And my report design is then a matter of placing the fields in the Detail section so I get the layout desired.  But no grouping, no footers, etc.  Very basic CR layout as all the work is really being done in the data source
IP IP Logged
Mike Hoyt
Newbie
Newbie


Joined: 19 Mar 2013
Online Status: Offline
Posts: 5
Quote Mike Hoyt Replybullet Posted: 19 Mar 2013 at 8:46am
Oh, sorry, misunderstood your question.  I deleted the label that CR automatically generated when I dropped the DataField in the Detail Section. I subsituted my TextBox.  Should I have just kept the automatic label?
IP IP Logged
Mike Hoyt
Newbie
Newbie


Joined: 19 Mar 2013
Online Status: Offline
Posts: 5
Quote Mike Hoyt Replybullet Posted: 19 Mar 2013 at 8:54am
OK, tried using the label that comes with the DataField.  And setting the Suppresson formula to

IsNull ( {DataField})

and that does it!  Thanks for the hint
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Mar 2013 at 9:09am
glad you got it Thumbs%20Up
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.