How to draw a line in Crystal Formula

melegant99
melegant99 used Ask the Experts™
on
Is there a way to draw a line in a Crystal Reports Formula?

Thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Will the line always be a constant length ?

Spykair
What are you trying to do?  Have a formula that produces a string and embed a line somewhere in that?  Have a line that only shows up under certain circumstances?  Have a line that is "variable" in some other way (length, width, color, etc.)?  Something else?

 James

Author

Commented:
yes, James, All of the above except it will always be the same length color and width.
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Commented:
Crystal is not so flexible when it comes to drawing line. It doesnt have any command to draw line or to supress a line with condition.

But as you said your line is going to be of same size and same colors then i guess your main problem could be about supressing. There is a work around for that. You can draw a line in Paint brush and save as an image and import into your report.

Now on this object you will have flexibility to supress by condition.

This is still not a very good idea but there is no other way out i think.

Commented:
Create a formula field which has your line in it and from there you can do all the conditional formatting.

Spykair
I'm still not sure exactly what you're trying to do, and that will really determine what options, if any, you have.

 For example, if you want to put an underline in the middle of some text, you could have a formula like:

"abc___def"

 If you only want that underline to be there if field1 is true, you could have a formula like:

"abc" + (if {field1} then "___" else "") + "def"


 If you want to have an underline that runs across the page, but only have it show up if field1 is true, you could, for example, create an empty text field that runs across the page, turn on the bottom border for that field, and suppress that text field is field1 is not true.  If that text field overlaps other fields, you might have to mess around with which fields are in front and which are in back (so that the empty text field doesn't cover the other fields).


 Like I said, it really depends on exactly what you're trying to do.

 James

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial