RDLC - IIF表达式错误 - 未为参数'FalsePart'

时间:2018-02-20 05:49:36

标签: rdlc

我有一个RDLC报告,其中包含以下表达式。

= IIF(     (Fields!EnvironmentalAuditorCompany.Value =“”和Fields!EnvironmentalAuditorPerson.Value<>“”),     (领域!EnvironmentalAuditorPerson.Value)         (             Iif(Fields!EnvironmentalAuditorPerson.Value =“”和Fields!EnvironmentalAuditorCompany.Value<>“”),             (领域!EnvironmentalAuditorCompany.Value)             Iif(Fields!EnvironmentalAuditorPerson.Value =“”和Fields!EnvironmentalAuditorCompany.Value =“”),“ - ”,             (Fields!EnvironmentalAuditorPerson.Value)& “,”& vbCr& vbLf& (领域!EnvironmentalAuditorCompany.Value)         )     )

但是,我收到以下错误消息

textrun的值表达式'EEnvAuditorPerson.Paragraphs [0] .TextRuns [0]'包含错误:[BC30455]未为'公共函数IIf'的参数'FalsePart'指定参数(表达式为布尔值,TruePart为对象,FalsePart As Object)As Object'。

请协助解决此问题。

以下是表达式的案例: 1.可能是其中一个有价值的字段(AuditPerson / AuditCompany),如果有的话填写相应的字段 2.两个字段都是空的,如果是这样的话 - (Hypen) 3.两个字段都有值,如果是,则用新行中的逗号分隔值

1 个答案:

答案 0 :(得分:0)

你的表达中有一些括号,而某些IIF确实缺少FalsePart。我不会试图理解你的表达的意思,只是简单地将它复制到文本编辑器中并排列你的IIF并修复相应的括号,我得到了这个:

    =Iif( 
         (Fields!EnvironmentalAuditorCompany.Value = "" and Fields!EnvironmentalAuditorPerson.Value<>""), 
         (Fields!EnvironmentalAuditorPerson.Value),
         Iif(
             (Fields!EnvironmentalAuditorPerson.Value = "" and Fields!EnvironmentalAuditorCompany.Value<>""), 
             (Fields!EnvironmentalAuditorCompany.Value), 
             Iif(
                 (Fields!EnvironmentalAuditorPerson.Value="" and Fields!EnvironmentalAuditorCompany.Value=""), 
                 " - ", 
                 (Fields!EnvironmentalAuditorPerson.Value) & "," & vbCr & vbLf & (Fields!EnvironmentalAuditorCompany.Value)
             ) 
         )
     )