【问题标题】:cross-tab conditional formatting based on column基于列的交叉表条件格式
【发布时间】:2013-07-23 08:35:46
【问题描述】:

我在水晶报表中有一个交叉表,列代表运输线,行显示日期,汇总字段代表 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) 会忽略它。

【问题讨论】:

    标签: crystal-reports report crosstab


    【解决方案1】:

    终于用 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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多