Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 我可以在reporting services 2008中对多重查找值求和吗_Vb.net_Reporting Services_Ssrs 2008 - Fatal编程技术网

Vb.net 我可以在reporting services 2008中对多重查找值求和吗

Vb.net 我可以在reporting services 2008中对多重查找值求和吗,vb.net,reporting-services,ssrs-2008,Vb.net,Reporting Services,Ssrs 2008,我有一个例子,我需要在另一个数据集中搜索固定数字(月份ID从1到12),并返回返回字段的总和 我使用了MultiLookUp函数,它应该如下所示: =code.SumLookup(Multilookup(Split("1,2,3,4,5,6,7,8,9,10,11,12" , ","), Fields!Transaction_Month.Value,Fields!Total_O_S_Loss___LAE_Reserve.Value , "DataSet3")) 其中,SumLookUp是我以前

我有一个例子,我需要在另一个数据集中搜索固定数字(月份ID从1到12),并返回返回字段的总和

我使用了
MultiLookUp
函数,它应该如下所示:

=code.SumLookup(Multilookup(Split("1,2,3,4,5,6,7,8,9,10,11,12" , ","),
Fields!Transaction_Month.Value,Fields!Total_O_S_Loss___LAE_Reserve.Value
, "DataSet3"))
其中,
SumLookUp
是我以前用于
lookupper
的代码,但它似乎不适用于
MultiLookUp

Dim suma As Decimal = New Decimal() 
Public Function SumLookup(ByVal items As Object()) As Decimal 
    If items Is Nothing Then 
        Return Nothing
    End If 
    Dim ct as Integer = New Integer() 
    suma = 0 
    ct = 0 
    For Each item As Object In items 
        suma += Convert.ToDecimal(item) ct += 1 
    Next 
    If (ct = 0) Then 
        return 0 
    else return 
        suma  
End Function 

Public Function GetMyVal() as Decimal 
    GetMyVal = suma  
End Function
你能提供一些建议如何做这样的事吗


谢谢

为什么不能使用
sum
功能

=Sum(MultiLookup(...))
在大脑放屁中编辑:

如果其中一个月没有返回值,会发生什么情况?我认为
multilookup
函数将为
items
对象(variantarray)内的每个
item
返回一个
nothing


我建议您在for循环中添加一个
if
语句,以捕获其中任何一个。

您是否收到错误?哪个错误?