多数据集 IIF 表达式

Multiple Datasets IIF Expression

我的项目中有 3 个数据集。我正在尝试在独立的文本框中创建一个表达式,如果 field.value 已填充,则报告 "Error Found!",如果 field.value 为空,则报告 "No Errors"。

=SUM(IIF(Fields!Account.Value = "","No Errors","Errors Found!"),"Account")

这是在回避 "Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope." 错误。

为避免多个数据集出现问题,我添加了 SUM 和 "Account" 以引用正确的数据集。

如果我将 TRUE/FALSE 替换为“1,0”,则该表达式有效。

尝试:

=IIF(Isnothing(First(Fields!Account.Value,"Account")),"No Errors","Errors Found!")

或者您可以使用:

=IIF(CountRows("Account")=0,"No Errors","Errors Found!")

其中 Account 是数据集的名称。

如果有帮助请告诉我。