Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula for setting borderstyle of text object

Status
Not open for further replies.

masonf

IS-IT--Management
May 28, 2002
17
US
I am recreating a paper form in Crystal Reports and there are items that are to be circled if selected. I want to be able to replicate this. The items are text objects and I've noticed that you can set the four borders to create a rectangle around the text, and that you can create a formula to control this.

What formula do I need to use to set the border to single when the boolean database value is true, and none when it is false?
 
Enter this formula for all 4 border Line Style options (Left, Right, Top, and Bottom):

if {Table.BooleanValue} then crSingleLine else crNoLine

or if you're database boolean field is a BIT datatype (applicable to SQL Server, maybe others:

if {Table.BooleanValue} = 1 then crSingleLine else crNoLine

-dave
 
What version are you using?

With 8.5, you will need to put this formula for each object's border (ie. left, right, top, bottom).
Code:
 if {table.field} then
    1  //value to indicate single
else
    0  //value to indicate none
you can also use 2 for Double, 2 for Dashed, or 4 for Dotted.

With 9 or 10, you can use the highlighting expert to do this. It is much easier here because you set up the logic once, and then you can define multiple formatting options in one place.

~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top