2

私のグループ合計は、データセット「dataset1」のグループの[Hours1]最初の値から最後の値を差し引く式です。[Hours1][EquipmentName1]

各機器のグループ式の合計の総計が必要です

データセット「dataset1」の最初の[Hours1]値から最後の[Hours1]値を減算する同じ式を使用できません。これは、

2つの機器がある場合、Equipment1とEquipment2と言います。

Equipment1 last [Hours1] = 10000 and first [Hours1] = 9500
Equipment2 last [Hours1] = 10500 and first [Hours1] = 10000

データセット[Hours1]の最初の値から最後の値を引く式を使用した場合、式は10500〜9500になります。[Hours1]"dataset1"

しかし、私は欲しい:

(10000 - 9500) + (10500 - 10000) = Grand Total

以下は私のテーブルの一部を描く試みです

|_[Hours1]_|  =  Fields!Hours1.Value    
(e.g. 9500)

|___Expr___|  =  Last(Fields!Hours1.Value) - First(Fields!Hours1.Value) 
(e.g. 10000 - 9500 = 500)

|__________|  =  I need to total the value of Expr for all pieces of equipment
4

1 に答える 1

0

これを実現するには、カスタムコードを使用する必要があります。

に移動しReport -> Report Properties -> Codeて入力します

Dim grandTotal As Integer;
Function AccumulateTotal(value as Integer)
    grandTotal = grandTotal + value
    return value
End Function

Function GetTotal()
    return grandTotal
End Function

次に、テキストボックスで、accumulate関数を呼び出す必要があります

=Code.AccumulateTotal(Last(Fields!Hours1.Value) - First(Fields!Hours1.Value))

また、Grand Totalテキストボックスで、gettotal関数を呼び出します。

=Code.GetTotal()
于 2012-10-12T15:02:40.733 に答える