cancel
Showing results for 
Search instead for 
Did you mean: 

Making bold in betwen a part of the big string based on condition

Former Member
0 Kudos

Hi All,

I am using Crystal XI.

I have a requiremnet to make a big continues string BOLD only a certain part not all the string. Based on some condition.

Example: abcdefg hijkl mano

Appreciated for your prompt reply.

Thank You,

Ashok

Edited by: Ashok on Sep 30, 2008 11:09 PM

Accepted Solutions (1)

Accepted Solutions (1)

former_member230846
Contributor
0 Kudos

Hi Ashok,

Please supply more detailed information about what you're trying to do, such as which specific conditions that the field data needs to be bold. How are you making a large continuous string or do you already have a formula field that contains the continuous string?

Regards,

Wallie

Former Member
0 Kudos

Hi Wallie,

In my big string there are labels and names.

Sport: Males Names, Female Names.

In the above string I have to make Bold the label Sport, and when ever I get female names as well, and all the male names are to be red color. Is it possible.

Every word is

Thank you,

Ashok

Former Member
0 Kudos

Hello,

I would suggest you create a formula field and in the formula editor put something like this:

crbold + Left ({stringfield}, 5) + ': ' + MID({stringfield}, 6, 20) + ', ' + crregular + crred + MID({stringfield}, 27, 20) + crblack

This assumes that in your stringfield the "sport" is always first, then it's followed by a semi-colon, then the male name is second and the femail name is third. You may need to change the hardcoded numbers and use the instr() function to get their relative starting and ending points in the string field.

Hope this helps!

Former Member
0 Kudos

Hi MK,

Its not working, If I use the formula like that; its throwing an error message.

I do not think, we can write like this

crbold + Left ({stringfield}, 5) + ': '

Thanks,

Ashok

Former Member
0 Kudos

Hi Ashok,

I suggest you to split the text into three parts like following three formulas

@Left:

left(field,0,10)

@Middle:

Mid(field,11,6)

@Right:

Right(field,17,10)

and place these formulas on the report and make the @Middle formula as bold by right clicking and going into format field and select bold in font style.

Now merge all these three formulas into a text object.

OR

write the text as

abcdefg <b>hijkl<b> mano

and go to the format field>paragraph>select the text interpretation to HTML Text.

I Hope this Helps!

Raghavendra

Answers (2)

Answers (2)

former_member260594
Active Contributor
0 Kudos

Ashok,

Use the replace function to replace the text in the string field you want bolded with the text surrounded in bold HTML tags, then turn on HTML Text Interpretation.

For example;

replace( , 'a', '<b>a</b>')

The forum will probably interpret the html here but you are replacing a with less than, b for bold, greater than, the string a, less than, whack, b for bold, and greater than.

You can add the condition in an if/then/else statement

Former Member
0 Kudos

Another option might be to use a text object and using formatting of the embedded data objects:

The athletes in the sport of {Sport} include {Athlete Name}

where the embedded fields are are formatted bold.

Fuskie

Who notes that regular strings can be embedded in a formula and thus formatted independently of the host text object...