0

Working with Crystal Reports' GridView object and trying to find a way to compare GridValues amongst a row of values and am having a very difficult time.

Here is the code I am working with in an embedded summary (located directly under the red boxes)...

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;

The problem is that the first Group isn't being looked at (I think...) I kind of fumbled my way to this point, so any advice is greatly appreciated.

hopefully this question is clear enough... but what I am trying to accomplish is setting the color to red for the gridvalue that is the most in the given row...

so the first row that contains 1, 1, 20, 0, 22, 22 I only want the embedded summary to give me 20 because its the largest number (Not counting the totals) and eventually, the red cell will be the largest number (20)

just using embedded summary to show what the value is.

enter image description here

Thanks!

4

1 回答 1

0

好吧,让它工作。这是我用来创建红色边框的公式...

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;
于 2016-02-26T13:57:31.460 回答