![](/img/trans.png)
[英]How to change the field background color in Crystal Reports using HTML?
[英]Crystal Reports changing field color using IF statement
我試圖根據比較兩個數據字段來更改水晶報表中一行的背景顏色。 例如。 If GPA_01 < GPA 02 then the background color should be red. else the background color should be white
If GPA_01 < GPA 02 then the background color should be red. else the background color should be white
。 嘗試創建公式時,我收到一條error message saying the " a number is expected here"
,在此情況下,在比較符號后加亮該字段。 我在想<之后的字段需要轉換為數字,但是我不確定該怎么做。
任何建議將不勝感激。
假定兩個字段是數字,請嘗試:
If {table.GPA_01} < {table.GPA 02} Then
crRed
Else
crNoColor
使用CINT()
轉換為整數
If CINT({table.GPA_01}) < cINT({table.GPA 02}) Then
crRed
Else
crNoColor
If CINT({table.GPA_01}) < cINT({table.GPA 02}) Then
'crRed'
Else
'crNoColor'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.