John Dwulet
John Dwulet

Reputation: 11

Conditional formating in Crystal Report

I'm a Crystal report (11) newb - Within a report I have a field for a vehicle VIN (Vehicle Identification Number). Right now the VIN prints simply as VIN: 1FAHP3438YW374102 . I would like to apply conditonal formating so the data would print the last 6 character in bold such as:

VIN: 1FAHP3438YW374102

Can that be done with a formula?

JD

Upvotes: 1

Views: 532

Answers (2)

craig
craig

Reputation: 26272

Another option is to create two formula fields, then embed them in a text object. Once embedded, you have a wide-range of formatting options.

//{@left}
{Command.VIN_NUMBER}[1 to 11]

//{@right}
{Command.VIN_NUMBER}[12 to Len({Command.VIN_NUMBER})]

Upvotes: 0

mechanical_meat
mechanical_meat

Reputation: 169494

You can do this in two steps. The first is to use the formula below. The second is to go into the "Format Field" dialog box and change the "Text Interpretation" to "HTML Text".

NumberVar x := 5; // you don't need a variable but it doesn't hurt 

// left part of string 
left({Command.VIN_NUMBER},len({Command.VIN_NUMBER}) - x) + 

// begin HTML tag for bold
"<b>" + 

// right part of string
right({Command.VIN_NUMBER},x) + 

// end HTML tag for bold
"</b>"

Upvotes: 1

Related Questions