Crystal Reports 2008 - Select statement to change background color
I am trying to change the background color using a select/case statement. However, I need to compare two fields in the same select statement.
{@Color_1} will display "1A" or "2A" {@Color_2} will display "1B", "2B", "3B", or "4B"
I have tried and I get 开发者_StackOverflow中文版an error
select {@Color_1},{@Color_2}
case "1A": crRed
case "2A": crYellow:
case "1B": crRed
case "2B": crYellow
case "3B": crRed
case "4B": crYellow
default: crNoColor
and also tried and none of the fields have color:
stringvar tag :={@Color_1};
stringvar tag :={@Color_2};
select tag
case "1A":
crRed
case "2A":
crYellow
case "1B":
crRed
case "2B":
crYellow
case "3B":
crRed
case "4B":
crYellow
default: crNoColor
I have also tried multiple IF, Then, Else combinations and it still does not work. Can someone provide a solution....PLEASE?!?!
It's been a few days, so you've probably solved it on your own by now. If not, try this:
- Select the field whose background you want to change.
- For this field, go into it's Properties menu, then Border, then the X-2 custom formula button.
- Try putting your criteria in this format:
If {@Color_1}="1A" then crlime else if {@Color_2}="2b" then cryellow else crnocolor
精彩评论