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.开发者_StackOverflow255.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
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]) )
精彩评论