简体   繁体   English

在 RDLC 表达式中,如何放置多个条件?

[英]In RDLC expression, how to put multiple conditions?

In RDLC report, I have a tablix on which I have already applied one condition to make it HIDDEN/VISIBLE.在 RDLC 报告中,我有一个 tablix,我已经应用了一个条件来使其隐藏/可见。

=IIF(First(Fields!IsSatisfactory.Value, "DataSetCNGCertificates"), true, false)

But now I need to apply this also,但现在我也需要应用这个,

=IIF(Fields!CNGStationStatus.Value = "2", true, IIF(Fields!CNGStationStatus.Value = "3", true, false))

but not sure how to put both together.但不确定如何将两者放在一起。 The later one shall be the first ot be checked.后一个应是第一个被检查的。

Why not just return the answer... Ex: (x=1 or x=2 or y='test')... The answer will return true or false, so you don't need 3 nested IIF() constructs为什么不只返回答案...例如:(x=1 或 x=2 或 y='test')...答案将返回真或假,因此您不需要 3 个嵌套的 IIF() 构造

If I understand you correctly you want the condition to check first the CNGStationStatus if its 2 , else, if its 3 , else, if IsSatisfactory is true.. Why not keeping with the nesting like:如果我对您的理解正确,您希望条件首先检查CNGStationStatus是否为2 ,否则,如果为3 ,否则,如果IsSatisfactory为真。为什么不与嵌套保持一致:

=IIF(Fields!CNGStationStatus.Value = "2", true, IIF(Fields!CNGStationStatus.Value = "3", true, IIF(First(Fields!IsSatisfactory.Value, "DataSetCNGCertificates"), true, false)))

? ?

Using the AND operator should be used if you like to check the condition at once:如果您想立即检查条件,则应使用AND运算符:

=IIF(Fields!CNGStationStatus.Value = "2" AND Fields!CNGStationStatus.Value = "3", true, IIF(First(Fields!IsSatisfactory.Value, "DataSetCNGCertificates"), true, false))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM