Ant Swift
Ant Swift

Reputation: 21177

Sum values in a group header

I have a group in reporting services 2005. In one of the header cells i have the following expression:

=IIF(Sum(Fields!DataInGb.Value) < 2, 0, Sum(Fields!DataInGb.Value) * 3 - 6)

In the report footer I need to sum the values of this cell for each group.

An example list of values returned by the dataset might be:

Cust 1 | 0.5
Cust 1 | 0.7
Cust 1 | 1.2
Cust 2 | 0.1
Cust 2 | 0.2
Cust 4 | 1.1

So that would mean 3 groups:
Cust 1 = 2.4
Cust 2 = 0.3
Cust 4 = 1.1

With expression values:
Cust 1 = 1.2
Cust 2 = 0.0
Cust 4 = 0.0

The report total should then be 1.2.

When I tired to use the same expression as above in the report footer, I got the value 0 since all the items in the dataset are less then 2. The expression needs to be performed on the group sums.

Can anyone suggest an expression to acheve this?

Upvotes: 1

Views: 5114

Answers (2)

Ant Swift
Ant Swift

Reputation: 21177

The eventual solution was to do the calculation in SQL Server and pass to the report that way.

Upvotes: 1

IordanTanev
IordanTanev

Reputation: 6240

your problem is very interesting but i found a solition in reporting service you can sum cell from the report itself so you do something like this

= Sum( Fields!Textbox1.Value )

where Textbox1 is the of the cell that contains the sum for the group

Upvotes: 0

Related Questions