【问题标题】:Crystal Reports: Cross-Tab calculating embedded summary comparing multiple cell valuesCrystal Reports:交叉表计算比较多个单元格值的嵌入式摘要
【发布时间】:2016-02-26 21:57:31
【问题描述】:

使用 Crystal Reports 的 GridView 对象并试图找到一种方法来比较一行值之间的 GridValues 并且遇到了非常困难的时间。

这是我在嵌入式摘要中使用的代码(位于红色框的正下方)...

local numbervar c;
local numbervar r;
local Numbervar cs:=GridValueAt(CurrentRowIndex,CurrentColumnIndex,CurrentSummaryIndex-1);
local numbervar MOST;

if GetColumnGroupIndexOf(1)=2 THEN
(
    for c:=0 to GetNumColumns-2 do    
    (   
        if cs >= GridValueAt(CurrentRowIndex,c,CurrentSummaryIndex-1) then MOST:=cs
        else MOST:=0;
    );
);
MOST;

问题是第一个组没有被查看(我认为......) 我有点摸索到这一点,所以非常感谢任何建议。

希望这个问题足够清楚......但我想要完成的是将给定行中最多的网格值的颜色设置为红色......

所以包含 1、1、20、0、22、22 的第一行我只希望嵌入式摘要给我 20,因为它是最大的数字(不计算总数) 最终,红细胞将是最大的数字(20)

只是使用嵌入式摘要来显示值是什么。

谢谢!

【问题讨论】:

    标签: gridview crystal-reports crosstab crystal-reports-formulas


    【解决方案1】:

    好的,开始工作了。这是我用来创建红色边框的公式...

    local numbervar c;
    local numbervar max:=0;
    
    for c:=0 to GetNumColumns-3 do    
    (     
        local numbervar value:=GridValueAt(CurrentRowIndex, c, CurrentSummaryIndex);
        if value > max then max:=value;
    );
    
    if gridvalueat(CurrentRowIndex,CurrentColumnIndex,CurrentSummaryIndex) = max then crred else crnocolor
    

    对于嵌入式摘要,只需将最后一行更改为

    max;
    

    【讨论】:

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