簡體   English   中英

Crystal Reports 2008-選擇語句以更改背景顏色

[英]Crystal Reports 2008 - Select statement to change background color

我試圖使用select / case語句更改背景顏色。 但是,我需要在同一條select語句中比較兩個字段。

{@ Color_1}將顯示“ 1A”或“ 2A” {@ Color_2}將顯示“ 1B”,“ 2B”,“ 3B”或“ 4B”

我嘗試過,但遇到錯誤

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

並且也嘗試過,所有字段都沒有顏色:

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

我還嘗試了多個IF,然后,其他組合仍然無法正常工作。 有人可以提供解決方案嗎?...請?!?!

已經過了幾天,所以您現在可能已經自己解決了。 如果沒有,請嘗試以下操作:

  1. 選擇要更改其背景的字段。
  2. 對於此字段,請進入“ 屬性”菜單,然后依次單擊“ 邊框”X-2自定義公式按鈕。
  3. 嘗試將您的條件設置為以下格式:
 If {@Color_1}="1A" then crlime else if {@Color_2}="2b" then cryellow else crnocolor 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM