AshHimself
AshHimself

Reputation: 4112

Crystal Reports Split Function within the Color Function

I have a field in a DB called option1 which holds RGB values like the following;

255.255.5 255.255.1 etc

I need my Crystal Report to read this field and change the color of a box. I tried the following;

color (Split({ac.option1}, ".")[1],Split({ac.option1}, ".")[2],Split({ac.option1}, ".")[3])

color (255,255,5) clearly works but this is giving me an error stating a number is required.

Any suggestions would be highly appreciated.

Regards,

Ash

Upvotes: 1

Views: 1046

Answers (1)

craig
craig

Reputation: 26262

You need to convert the results of the Split() function to numbers:

Color( ToNumber(Split({ac.option1}, ".")[1]), ToNumber(Split({ac.option1}, ".")[2]), ToNumber(Split({ac.option1}, ".")[3]) )

Upvotes: 2

Related Questions