[英]Crystal Reports 2008 - Select statement to change background color
I am trying to change the background color using a select/case statement. 我试图使用select / case语句更改背景颜色。 However, I need to compare two fields in the same select statement. 但是,我需要在同一条select语句中比较两个字段。
{@Color_1} will display "1A" or "2A" {@Color_2} will display "1B", "2B", "3B", or "4B" {@ Color_1}将显示“ 1A”或“ 2A” {@ Color_2}将显示“ 1B”,“ 2B”,“ 3B”或“ 4B”
I have tried and I get 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. 我还尝试了多个IF,然后,其他组合仍然无法正常工作。 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: 如果没有,请尝试以下操作:
If {@Color_1}="1A" then crlime else if {@Color_2}="2b" then cryellow else crnocolor
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.