Reputation: 4112
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
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