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!

Color coding a text field

Status
Not open for further replies.

roswelltx

Technical User
Aug 31, 2005
21
US
Hi all. I have a long text field. If i want to show a certain word in RED when it finds it in this text field, is there a way to do this?
Thanks
Regina
 
A text field that you've inserted? Why not just format the color when inserting it?

Perhaps you mean a string type of field, a text field is a type of field within Crystal for typing text or inserting fields into.

You might accomplish this by parsing out the string into words before the word, the word, and then after the word, or you might use HTML formatting in some way as well.

Could even be that you could use a SQL Expression and embed HTML formatting within the field using a replace function.

Things like the version of your software and whether this is a typed text field or you mean a database field or a formula, etc., would be useful to know so that we don't waste time.

-k
 
I am looking for the same solution. I have a text FIELD which I am pulling from my database. I would like to highlight specific words. I have struggled with this. Would there be a recommended formula which can be used?
 
Sorry, I'm bad on being vague. It is a DB field and it actually is a long memo type field. I am using Crystal 10.
Thanks
 
You can do this in a formula:

replace({table.memofield},"Your Phrase Here","<font color=red>Your Phrase Here</font>")

Swap your memo field for {table.memofield}.
Swap the text you want to color for the 2 occurances of "Your Phrase Here".

Place the field on the report in place of the original field.
Right click the field, choose Format Field, and then under the Paragraph tab, change Text Interpretation to HTML Text

~Brian
 
Brian's solution should be fine if you have CR 9 or above, again, you are being intentionally *vague* as you term it about sharing required information, even after specifics are requested.

If you have CR 8.5 or below, you'll need another solution.

One line posts invariably result in additional posts wherein we try to describe your environment and your requirements, please take the time to do so in future posts.

-k
 
I'm sorry but I do not understand:
"Things like the version of your software and whether this is a typed text field or you mean a database field or a formula, etc., would be useful to know so that we don't waste time."
This is what you asked for and I answered all of that in my last post. CR10 and it is a DB field that is Memo Type. I'm not seeing what you are saying I am not giving you that you asked for. Sorry.
 
My apologies, I had thouyght that I'd asked for the database type and connectivity, as well as other things I usually do.

Brian's solution should work fine for you, if not, please post the problem.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top