2014-10-28 48 views
0

我试图根据比较两个数据字段来更改水晶报表中行的背景颜色。例如。 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"它突出显示比较符号后面的字段,即<。 我想<需要转换为数字后,但我不知道该怎么做。Crystal Reports使用IF语句更改字段颜色

任何意见将不胜感激。

回答

0

假设这两个领域是数字,尝试:

If {table.GPA_01} < {table.GPA 02} Then 
    crRed 
Else 
    crNoColor 
0

使用CINT()转换为整数

If CINT({table.GPA_01}) < cINT({table.GPA 02}) Then 
    crRed 
Else 
    crNoColor 
0
If CINT({table.GPA_01}) < cINT({table.GPA 02}) Then 
'crRed' 
Else 
'crNoColor' 
相关问题