基于列的交叉表条件格式

时间:2013-07-22 23:51:52

标签: crystal-reports report crosstab

我在水晶报表中有一个交叉表,其中列表示传输线,行显示日期,汇总字段表示TEU(它只是数值)。所以我有这样的事情:

    L1  L2  L3 TOTAL
D1  10  5   0  15
D2  1   3   5  9
D3  3   50  17 70

现在我想有条件地将背景放在摘要(数字)字段中,但条件也取决于该行。所以理论上,在点击摘要字段 - >格式字段 - >背景 - >公式之后,我会添加如下内容:

select {@Line}
case "L1": (if currentfieldvalue >5 then crGreen else crRed)
case "L2": (if currentfieldvalue >10 then crGreen else crYellow)
case "L3": (if currentfieldvalue <8 then crBlue else crNoColor)

但由于某些原因,这些条件完全被忽略。我甚至尝试过像

这样简单的事情
if {@Line} ="L1" then crGreen

但如上所述,2011年水晶(14.06)忽略了它。

1 个答案:

答案 0 :(得分:0)

最后使用GridRowColumnValue(“@ Line”):

select GridRowColumnValue ("@Line")
case "L1": (if currentfieldvalue >5 then crGreen else crRed)
case "L2": (if currentfieldvalue >10 then crGreen else crYellow)
case "L3": (if currentfieldvalue <8 then crBlue else crNoColor)

来源:http://www.crystalreportsbook.com/Forum/forum_posts.asp?TID=6798

相关问题