Reporting services SSRS错误索引超出了数组的界限。(rsRuntimeErrorInExpression)
我正在SSRS中构建一个报告,我得到一个错误提示:Reporting services SSRS错误索引超出了数组的界限。(rsRuntimeErrorInExpression),reporting-services,Reporting Services,我正在SSRS中构建一个报告,我得到一个错误提示:索引超出了数组的界限(rsRuntimeErrorInExpression) 我尝试了不同的表达来解决这个问题,但我无法让它工作。我目前有: =iif(LEN(Fields!Comment.Value) - LEN(REPLACE(Fields!Comment.Value, ",","")) > 3, Split(Fields!Comment.Value, ",")(3), Nothing) 有人能告诉我如何解决这个问题吗?这个错误与S
索引超出了数组的界限(rsRuntimeErrorInExpression)
我尝试了不同的表达来解决这个问题,但我无法让它工作。我目前有:
=iif(LEN(Fields!Comment.Value) - LEN(REPLACE(Fields!Comment.Value, ",","")) > 3, Split(Fields!Comment.Value, ",")(3), Nothing)
有人能告诉我如何解决这个问题吗?这个错误与SSR试图计算分割表达式有关,即使Iif条件为false 您可以使用嵌套的Iif来返回有效的索引值,如0,以使拆分始终工作,而不是将静态值3作为数组索引
=iif(
LEN(Fields!Comment.Value) - LEN(REPLACE(Fields!Comment.Value, ",","")) >3
, Split(Fields!Comment.Value, ",")(
iif(
LEN(Fields!Comment.Value) - LEN(REPLACE(Fields!Comment.Value, ",","")) >3
,3
,0
)
)
, Nothing
)
非常感谢,我试过了,效果非常好!