0

我的报告中有以下代码:

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

上面的函数返回suma,我通过以下方式调用该函数:

code.SumLookup(LookupSet(Fields!Claim_Currency.Value,Fields!Claim_Currency.Value,Fields!Total_Paid_Loss___LAE.Value, "dataSet"))

我想在我的报告suma中使用这两个变量。ct

如何调整函数以使其返回两个变量,然后如何从报告中调用它们?

4

1 回答 1

0

如果您将 ct 声明为公共变量,那么您可以在代码中以 Code.Variable 的形式访问它。

Public ct As Integer

tb1=code.SumLookup(LookupSet(Fields!Claim_Currency.Value,Fields!Claim_Currency.Value,Fields!Total_Paid_Loss___LAE.Value, "dataSet"))

tb2=code.ct
于 2013-03-07T22:09:12.437 回答