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!

Format only a portion of text if condition is met 2

Status
Not open for further replies.

sjp0362

Technical User
Oct 23, 2004
48
US
Crystal Reports ver. 9.2

We have a field in which we may enter long information. Occasionally we may enter returns into this field also, thus creating various paragraphs.

If we enter a return followed by "--UPDATE", we want "--UPDATE" printed in bold. Any suggestions?

I have tried the following two formulas and changed the formula to Text Interpretation to HTML Text.

1. replace ({PMMI.Minutes},"--UPDATE","<b>--UPDATE<b>")

2. replace ({PMMI.Minutes},"--UPDATE","<h4>--UPDATE")

The problem with either of these formulas is that loose all the returns that were entered into the field.

Does someone have a suggestion?
 
It sounds like the text interpretation when the bold tags are added is causing the loss of the returns. One way of dealing with this would be to break the field into three separate formulas, and then drop them into a text box. Try:

//{@left}:
left({table.string},instr({table.string},"--UPDATE})-1)

Drop this into a text box until it clicks into place.

//{@middle}:
<b>--UPDATE</b>

Add {@middle} to the report and format it to text interpretation = HTML text before dropping it into the text box. Finally add the following formula to the text box:

//{@right}:
mid({table.string},instr({table.string},"--UPDATE")+9)

-LB
 
Dear sjp0362,

Yes,replace all occurences of chr(13) (carriage return) or chr(10) (line feed) with <BR>.
Thus, your formula would be:

Replace(
replace(
replace ({PMMI.Minutes},"--UPDATE","<b>--UPDATE<b>"),
chr(10),'<BR>'),
chr(13),'<BR>')

Hope that helps,

regards,

ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
You both are awesome! Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top