에 코드 값을 반환합니다.어떻게 내 보고서에서 아래의 경우이 변수
Public 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
문제는 Rec/Prod입니다. prod = 0 인 경우 오류가 발생합니다.
필자는 아래의 조건을 넣어 시도 :
IIF(code.SumLookup(LookupSet(Fields!Currency_Type.Value, Fields!Currency_Type1.Value,Fields!Gross_Premium_Amount.Value, "DataSet2"))=0,0,RunningValue(Fields!Receivable.Value,SUM,Nothing)/(code.SumLookup(LookupSet(Fields!Currency_Type.Value, Fields!Currency_Type1.Value,Fields!Gross_Premium_Amount.Value, "DataSet2"))))
하지만 거짓 상태에서 내가 녹화에 대한 오류를 생산에 0을 regetting의 값을 얻을 consiquently 내가 얻기 위해 code.SumLookup을 회수하고 이후/찌르다.
시간에 code.sumlookup을 호출하여 값을 변수에 저장하면 값을 확인해야 할 때마다 호출 할 필요가 없습니다.
또는 다른 해결책이 있으면 알려주십시오.
귀하의 질문에 소개, 상호 작용 및 일반적인 흐름이 부족합니다. 질문을 검토하고 편집하여 조금 더 편하고 (그리고 더 즐거운) 읽을 수 있었습니까? – Jeroen