Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.9k views
in Technique[技术] by (71.8m points)

c# - RDLC Report Expressions

I have an image in RDLC report, this image has a visibility expression ie.. if values match then make it visible or hide depending on the value. It's a very small line of code so please bare with me on the details, this is all I have on this.

 =IIf(First(Parameters!ID.Value)="3" OR (Parameters!ID.Value)="2" AND (Parameters!LocationID.Value)<>"18"   ,false,true)

This code indicates that make the Image visible if the IDs are '3' or '2' and Location is not '18' but for some reason, it's visible for location 18 too.

My desired result is, make the image visible if the Location is not 18 and IDs 3 or 2. Else if the Location is 18, make it hidden. Right now for Location 18, I have another image that then becomes visible, currently, both of these images become visible.

Please let me know if you need more details on this.

Thanks!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You are missing parentheses, because the expressions are related, try it like this:

=IIf((First(Parameters!ID.Value)="3" OR (Parameters!ID.Value)="2") AND ((Parameters!LocationID.Value)<>"18")   ,false,true)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...