on 07-26-2021 3:26 PM
Hello,
I am looking to set the background of my fields where I have the colour specified within my query.
For example I have my answer field and a colour has been associated with this field by the user called 'AnswerColour' where within that it will HEX colour code e.g. #3be711.
I need the query to use the colour within this field and set it as the background.
Unfortunately, Crystal doesn't seem to be able to take colors in this format. It can however, take them in RGB format using a formula like this:
if not IsNull({MyTable.AnswerColour}) then color(R, G, B) else crNoColor
Another possible way to do this would be to determine what each possible color is and, if it's one of the colors defined by Crystal's color constants, replace it by the constant. You can search for "Color Constants" in the Crystal Help to see what they are.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can convert hex to rgb using Crystal formula logic as shown below.
This type of conversion is made easier by using a UFL that converts hex to numeric values.
See list of 3rd-party UFLs here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Right-click the field in Crystal Reports Designer,
Select 'Format Field...',
Select 'Border' tab.
Enter a dynamic expression for the 'Background' property.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.