Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: A bold formula Post Reply Post New Topic
Author Message
Scrapple
Newbie
Newbie


Joined: 13 Jan 2009
Online Status: Offline
Posts: 2
Quote Scrapple Replybullet Topic: A bold formula
    Posted: 13 Jan 2009 at 7:04am
This may not be even possible so I thought I would ask. I have been away from Crystal for awhile and things are still a bit foggy. I have a report with a formula that is empty. In my vb.net code I send a string into this empty formula in my report which then displays this string in the report if the string is not empty. Works fine. Is there a way to set selected words in this string to bold? There are some words and numbers in this string I pass in that the end user wants to set as bold. The end user has no control to change anything in the report. My code generates it and it is displayed for the user to print out and mail.
 
Thanks,
Steve
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Jan 2009 at 7:31am
Right click on the field and select Format Field.
Select the Font tab and clcik ont he formula editor next to the Style.
Put your formula here:
if {Field}="condition" then crBold else crRegular
IP IP Logged
Scrapple
Newbie
Newbie


Joined: 13 Jan 2009
Online Status: Offline
Posts: 2
Quote Scrapple Replybullet Posted: 13 Jan 2009 at 7:39am
Thanks for your reply. However, that would bold the entire output of the formula. I am passing the string in from vb.net code and I only want to bold certain words in the string when it shows up on the report, not the entire string. The string I pass in is actually a paragraph in a letter where the user only wants to bold maybe 3 or 4 words in this paragraph.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Jan 2009 at 7:52am
Sorry, misunderstood your question. I do not know how to assist on this one...
Anyone else?
IP IP Logged
GrisCorp
Groupie
Groupie
Avatar

Joined: 08 Mar 2013
Online Status: Offline
Posts: 64
Quote GrisCorp Replybullet Posted: 18 Sep 2014 at 7:58am
I know this thread is incredibly old, however, I just discovered how to do what the OP requested and thought it may help someone else on here in the future.

In order to bold selected words/fields in a formula you will need to surround them with html tags for bold, <b> </b> , and format the field as HTML.

For example, I have this formula:

if not isnull({PartMast_Ext.SUPMAT_ID})
then
"Part ID:  " + "<b>"+{PartMast_Ext.SUPMAT_ID}+"</b>"


Place the formula in the report then right-click it and select Format Field.  Then select the Paragraph tab and in the Text Interpretation section select HTML Text.

The formula then displays/prints like this:

Part ID: 56134-F

You can also use html tags to, italicize, change the font, the size and/or the color, etc. of the selected words/fields you choose.


Edited by GrisCorp - 18 Sep 2014 at 7:59am
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.