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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formating a text

Status
Not open for further replies.

sunisree

Programmer
Jul 22, 2003
4
US

I have a string field which has values like
carpet hwpctl correct etc.. and i want to bold the text where i find the carpet and correct in that string. remaining part of the text should stay normal(regular font size) the data is populted from the database.
 
You have 2 options:

Use HTML formatting (which means you'll get a slight difference in font appearance overall)

Parse the field into formulas and drop them all into a text object, with the carpet and correct being bolded formulas.

Since you didn't share an example of your data, rather a text description, I'll forego an example of the 2nd solution, if you decide you need additional help, please share some real environment information.

The 1st solution is version dependent, but the methodology would be to create a formula which contains something like:

whileprintingrecords
stringvar NewString;
newstring := replace(replace({Bob.Ship Via},&quot;Carpet&quot;,&quot;<B>Carpet</B>&quot;),&quot;Correct&quot;,&quot;<B>Correct</B>&quot;);
newstring

(Note that you may have to add an HTML font size also to make it look right)

Now place the formula in the report, right click and select Paragraph Formatting->and set Text Interpretation to HTML text

-k
 
HI!,

First i want to thank you but as you said i didnot specify the problem exactly but the way which yopu have given me worked out fine and it the string comes from the database. and i formatted it but, it did not solve my problem completely like the font size has becomea big issues i put the font size it works fine for the replaced string and the other part of the string could not be controlled .. is there any way to make the remaining part of the string also the same size........

Example string has the following values
(carpet correct values example)
i made the carpet and the values to bold but the other remaining datas font size is bigger......

<replace(inputsring, &quot;carpet&quot;, &quot;<font face:'arial' size: '2' < b> Carpet</b></font>&quot;)

Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top