2010-07-01 46 views
0

我有一個報告,顯示僅僅指剛在像這樣的列表客戶名稱:Reporting Services的條件行顏色

ATK 
FLD 
FLD 
DB 
DB 
DB 
BL 

我已經讓他們分組並一切,但我想知道如果有一種方法,使之如此我可以用顏色分隔的每個客戶端,例如白色,然後灰色,最後再白灰色等

現在我使用的背景顏色,如下所示:

=IIF(RowNumber(Nothing) Mod 2,"Gainsboro","White") 

這只是使其他行都變成白色或灰色。有沒有辦法讓所有其他客戶變白或變灰?

回答

1

在報表的自定義代碼添加以下內容: -

Public shared currentRowColour as string = "Red" 

    public function GetBackGroundColour(previousValue as string, currentValue as string) as string 

     if previousValue <> currentValue then 
      if currentRowColour = "Red" then 
       currentRowColour ="Orange" 
      else 
       currentRowColour ="Red" 
      end if 
     end if 
     return currentRowColour 

    end function 

然後編輯背景色表達您的文本框(或行) = Code.GetBackGroundColour(上一頁(場! Value),Fields!.Value)