I have a text field that has different notes added by different staff. Each staff prefix their notes with their initials. I want to search for the prefix say 'CS' and highlight the whole block of text with that prefix.
Is your example from one record or three? If from three, then my earlier suggestion should work, although you would add separate clauses for each user code, as in:
if left(trim({table.string}),2) = "CS" then cryellow else if left(trim({table.string}),2) = "AB" then crred else
if left(trim({table.string}),2) = "LM" then crgreen else crnocolor
If this doesn't work, please share the error message you are getting.
If this is CR 9/10 you can apply formulas to the memo field. Create a formula that looks for those initials and construct an HTML expression (using HTML tags and Crystal functions such as InStr() and MID() ) to highlight each portion.
Then, place the resulting formula on the report layout and set the Text Interpretation" option (Format editor, Common Tab) to HTML.
hth,
- Ido
CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
If there are multiple users per record, you might be able to use the split function, if there is a return before each new user:
//{@split1}:
split({table.string}, chr(13))[1]
//{@split2}:
if ubound(split({table.string},chr(13))) > 1 then
split({table.string},chr(13))[2]
//{@split3}:
if ubound(split({table.string},chr(13))) > 2 then
split({table.string},chr(13))[3]
You could place these in separate detail sections, one below the other, and then use a field formatting formula like:
if left(trim({@split1}),2) = "CS" then cryellow else
if left(trim({@split1}),2) = "AB" then crred else
if left(trim({@split1}),2) = "LM" then crgreen else crnocolor
...changing the formula name to match the formula field you are formatting.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.