Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.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
Reporting services SSRS如何动态进行范围查找?使用参数_Reporting Services_Ssrs 2008 - Fatal编程技术网

Reporting services SSRS如何动态进行范围查找?使用参数

Reporting services SSRS如何动态进行范围查找?使用参数,reporting-services,ssrs-2008,Reporting Services,Ssrs 2008,嵌套在报表属性中的自定义代码: 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 item As Object In ite

嵌套在报表属性中的自定义代码:

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 item As Object In items  
suma += Convert.ToDecimal(item)  
ct += 1  
Next  
If (ct = 0) Then return 0 else return suma   
End Function 
我的命令如下:

=Code.SumLookup(LookupSet("9040101", Fields!norek.Value,Fields!tgl10.Value, "NR_01"))
如果我运行该命令,结果不会出错。该值将为100

我只想让
范围:“NR_01”
动态变化,当参数也发生变化时,我使用
参数!纳米表数值
。所以我改变了:

从范围数据集:“NR_01”到范围:“参数!nm表值”

变成这样

=code.SumLookup(LookupSet(“9040101”,Fields!norek.Value,Fields!tgl10.Value,“Parameters!nm_tabel.Value”))

但是我发现一个错误,
“…textrun'Textbox12.段落[0].TextRuns[0]'的值表达式的作用域参数对查找函数无效。作用域参数必须设置为字符串常量,即数据集的名称…”

如何转换参数以满足该范围的要求


感谢Best Regardz

我尝试将作用域数据集转换为字符串,使其成为
=code.SumLookup(LookupSet(“1040101”,Fields!nosbb.Value,Fields(“tgl”&Parameters!nm_kolom.Value)。Value,Trim(Parameters!nm_tabel))
。但是仍然可以在不使用“around the Parameters!nm_kolom.Value”的情况下尝试出错,否则您将把它转换为字符串而不是获取值