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

Bolding certian text 1

Status
Not open for further replies.

netcashin

Programmer
Nov 13, 2000
159
US
I have a report (Crystal 8.0) that is tied to a VB application. Within the appliction a search term is selected and data records with that term are passed to the report. I wish for the term to be bolded in the body of the text that is being passed.

Any suggestions?
 
look for Rosemary's articals on this ... she is the expert on this subject.

I think you have to surround the HTML with double quotes as I recall as well Jim Broadbent
 
Ngolem: If you're building the entire field to be bolded in a formula, you use double quotes around the literal bolding HTML code:

&quot;<b>&quot; + {MyTable.MyField} +&quot;</b>&quot;

As I understand this requirement, I addressed the concept of within the VB app bolding the text PRIOR to returning it to Crystal.

So the text would already have the HTML embedded:

<b> searched for </b>

Obviously you wouldn't want to place quotes in that.

I don't think that Rosemary's articles address this subject, they address bolding text as literal or as a complete field.

An alternative within Crystal might be to use a parameter in the report and set the parameter (in VB) to the searched for text, then use a replace on the field to wrap the searched text:

replace({field},{?parm},&quot;<b>&quot; + {?parm} +&quot;</b>&quot;

Should also work...

-k kai@informeddatadecisions.com
 
OK, I tested the latter and it works too.

replace({field},{?parm},&quot;<b>&quot; + {?parm} +&quot;</b>&quot; )

It will bold the {?parm} portion of a field, so the VB app can just set this parm and execute the report. Use the above formula as the replacement for your database field.

The problem here is that you're limited to fields of 254 chars or less.

-k kai@informeddatadecisions.com
 
Dear All,

Just to clarify. If a field exits in a database or is passed from an application and contains html tags, simply formatting the field as HTML text will correctly display the HTML (assuming no errors in the tags).

If you have a requirement to include formatting that is not contained in the field, you do this by including html tags (wrapped in quotes) within a formula to produce your required formatting.

Be aware, that the crystal web viewers do not always respect the formatting and that crystal.net is not currently capable.

(Nice addition to the available information SynapseVampire).

Also, if you are returning text in a formula you can start and end the tags anywhere where &quot; &quot; are available.

So this would be valid:
&quot;<b> <color = red> My Text &quot; + {databasefield} +
&quot;<color = black>&quot; //we are still bold
+ {anotherdbfield +&quot;</b> +&quot;More text&quot;

I am posting so late to this as I am traveling on business. (Hi from Baltimore!)

ro Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Thanks for contributing, Ro. I should have mentioned that some viewers won't preserve it, and I didn't realize that .net was incapable, you'd think it the most likely candidate...

Hope you're enjoying your travels.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top