【问题标题】:For each crosstab column, highlight maximum value对于每个交叉表列,突出显示最大值
【发布时间】:2012-05-12 04:26:29
【问题描述】:

我试图突出显示 Crystal Reports 交叉表列中的最大值,每列,即显示每个月表现最好的推销员。

这似乎是一个相当基本的要求,但我无法弄清楚!突出显示专家似乎是显而易见的答案,但它仅在您定义了标准(例如总销售额> 120,000)时才有效,并且我对突出显示列/行末尾的总计不感兴趣......我只想要每列的最高值行。

【问题讨论】:

  • 只是在想......这是我可以用几个 For 循环来做的事情吗?我知道有一些函数可以获取列数/行数等...

标签: crystal-reports formatting conditional crystal-reports-2008 crosstab


【解决方案1】:

这比它需要的要困难得多......

将此文本添加到汇总字段的“工具提示文本”条件格式公式中:

// this assumes that there is a Total column and that it is the left-most column.

Numbervar max:=0;
local Numbervar col;

// exclude (left-most) total column
for col := 1 to GetNumColumns-1 do (

    local numbervar value := GridValueAt (CurrentRowIndex, col, CurrentSummaryIndex);
    if value > max then max := value;

);

ToText(max,"#");

然后将此文本添加到 same 字段的“样式”条件格式公式中:

Numbervar max;

If GridValueAt (CurrentRowIndex, CurrentColumnIndex, 0) = max Then
    crBold
Else
    crRegular

【讨论】:

  • 这太完美了,谢谢!顺便说一句,我稍微调整了工具提示公式以按我的意愿工作;我在 X 轴上有销售价值,在 Y 轴上有月份。最终调整如下所示:// this assumes that there is a Total and that it is the bottom row. Numbervar max:=0; local Numbervar row; // exclude bottom total row for row := 0 to GetNumRows-2 do ( local numbervar value := GridValueAt (row, CurrentColumnIndex, CurrentSummaryIndex); if value > max then max := value; ); ToText(max,"#");
  • 解决这个问题的好方法
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-10
  • 2021-10-04
  • 1970-01-01
  • 1970-01-01
  • 2019-12-12
  • 1970-01-01
相关资源
最近更新 更多