
The LookUpSet function returns objects or array of objects.
Cannot use the default SUM function to sum the values returned.
The following VB script needs to be added as a function in the report (Report > Report Properties > Code)
Public Function SumLookup(ByVal items As Object()) As Decimal
Dim suma As Decimal = 0
For Each item As Decimal In items
suma += item
Next
Return suma
End Function
Then in the expression use Code.SumLookup(<lookupset function>)
Note*:
- Please reference my previous blog here regarding using VB script in SSRS reports
- Please reference my previous blog here regarding using the lookupset function