对于每个交叉表列,突出显示最大值 [英] For each crosstab column, highlight maximum value

查看:196
本文介绍了对于每个交叉表列,突出显示最大值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



一个相当基本的要求,但我不能算出来!突出显示专家似乎是明显的答案,但它只有在您已定义标准(例如总销售额> 120,000)时才有效,并且我不想在列/行的末尾突出显示总计。我只想要每列的最高价值行。

解决方案

p>

将此文本添加到摘要字段的工具提示文本条件格式设置公式中:

  //这假设有一个Total列,并且它是最左边的列。 

Numbervar max:= 0;
local Numbervar col

//排除(最左边的)总列
为col:= 1到GetNumColumns-1 do(

本地numbervar值:= GridValueAt(CurrentRowIndex, col,CurrentSummaryIndex);
如果value> max then max:= value;

);

ToText(max,#);

然后将此文本添加到相同字段的样式条件格式公式:

  Numbervar max; 

如果GridValueAt(CurrentRowIndex,CurrentColumnIndex,0)= max then
crBold
Else
crRegular


I'm trying to highlight the maximum value in a Crystal Reports crosstab column, per column, i.e. show the best performing salesman in each month.

It seems like a fairly basic requirement, but I can't figure it out! The Highlighting Expert would seem to be the obvious answer, but it only works if you have defined criteria (e.g. Gross Sales > 120,000), and I'm not interested in highlighting the Totals at the end of the columns/rows....I just want the highest value row per column.

解决方案

This is much more difficult than it needs to be...

Add this text to the summary field's "Tool Tip Text" conditional-formatting formula:

// 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,"#");

Then add this text to the same field's "Style" conditional-formatting formula:

Numbervar max;

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

这篇关于对于每个交叉表列,突出显示最大值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆