【发布时间】:2016-07-27 19:50:26
【问题描述】:
我有一个在 Excel 中用作宏的 VB 代码。我想在 SSRS 中使用相同的代码作为自定义代码,但结果是 #Error。这是代码
Public Function ErlangC(ByVal m As Integer, ByVal u As Double) As Double
Dim d as Double
Dim s as Integer
Dim k as Integer
d = PowerFact(m, u)
s = 1
For k = 1 To m - 1
s = s + PowerFact(k, u)
Next k
ErlangC = d / (d + (1 - u / m) * s)
End Function
Public Function PowerFact(ByVal m As Integer, ByVal x As Double) As Double
Dim s as Integer
Dim k as Integer
s = 0
For k = 1 To m
s = s + Math.Log(x / k)
Next k
PowerFact = Math.Exp(s)
End Function
我在 SSRS 中有一个带有表达式的文本框
=Code.ErlangC(65,60)
当我运行报告时,文本框中的值为#Error。
谢谢。
【问题讨论】:
标签: vb.net reporting-services ssrs-2008-r2