Hi
New to this....self taught!
I use reportbuilder and have hit a problem with summing LookupSet expression. I've got 2 datasets, the join returns Pord_Value as I would expect, however cannot get the Pord_Value to sum (total)
used the following so far.....any guidance would be appreciated
=join(Lookupset(Fields!Pord_POId.Value,Fields!Pord_POId.Value,Fields!Pord_POValue.Value, "DataSet2"),",")
Report properties code, I inserted:
Function SumLookup(ByVal items As Object()) As Decimal
If items Is Nothing Then
Return Nothing
End If
Dim suma As Decimal = New Decimal()
Dim ct as Integer = New Integer()
suma = 0
ct = 0
For Each items As Object In items
suma += Convert.ToDecimal(item)
ct += 1
Next
If (ct = 0) Then return 0 else return suma
End Function
To calculate the total for column Pord_Value
=code.sumlookup(Lookupset(Fields!Pord_POId.Value,Fields!Pord_POId.Value,Fields!Pord_POValue.Value, "DataSet2"),",")
Result - returns the value from the 1st entry as the total sum...Mmmmm!