2013-08-20 44 views

回答

3

我不認爲你可以。該corresponding MSDN documentation提到,您可以使用參數自定義組件:

您可以通過自定義代碼在報告中定義的代碼塊或您提供的自定義程序集引用全局參數集合。參數集合是隻讀的,沒有公共迭代器。

但是,提供的例子都要求您提供所有參數或者只有一個參數作爲自定義代碼函數的參數,例如,

' Passing an entire global parameter collection to custom code. 
' This function returns the value of a specific report parameter MyParameter. 
Public Function DisplayAParameterValue(ByVal parameters as Parameters) as Object 
    Return parameters("MyParameter").Value 
End Function 

和:

' Passing an individual parameter to custom code. 
' This example returns the value of the parameter 
' passed in. If the parameter is a multivalue parameter, 
' the return string is a concatenation of all the values. 
Public Function ShowParameterValues(ByVal parameter as Parameter) 
as String 
    Dim s as String 
    If parameter.IsMultiValue then 
     s = "Multivalue: " 
     For i as integer = 0 to parameter.Count-1 
     s = s + CStr(parameter.Value(i)) + " " 
     Next 
    Else 
     s = "Single value: " + CStr(parameter.Value) 
    End If 
    Return s 
End Function 
相關問題