web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

IIF (conditional expression) in SSRS report

(0) ShareShare
ReportReport
Posted on by

Please note that this report's design has tablix and on the tablix there are rectangles.

SSRS report with RDP class and temp table. I'm trying to hide fields in different rectangles. Let me know if I'm doing anything wrong or any error in expressions.  Thanks!!

Logic:

 If brake type is "Thruster Brake" then hide Coil Brake rectangle and Hyraulic Brake rectangle.

Expression : 

=IIF((First(Fields!Mag_BrakeTypes.Value, "Mag_BrakeTable") = "Coil Brake" & "Hydraulic Brake"), false, true)

  1. Pink color rectangle

Logic:

If brake type is "Coil Brake" then hide Thruster brake and hydraulic brake

Expression:

=IIF((First(Fields!Mag_BrakeTypes.Value, "Mag_BrakeTable") = "Thruster Brake" & "Hydraulic Brake"), false, true)

  1. Blue color rectangle

Logic:

If brake type is "Hydraulic brake" then hide Thruster brake and Coil Brake.

Expression:

=IIF((First(Fields!Mag_BrakeTypes.Value, "Mag_BrakeTable") = "Thruster Brake" & "Coil Brake"), false, true)

Running AX 2012 R3 with Visual Studio 2010.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Anton Venter Profile Picture
    20,656 Super User 2026 Season 1 on at

    Hi, the part that doesn't make sense is in bold below. The field value cannot be both values.

    =IIF((First(Fields!Mag_BrakeTypes.Value, "Mag_BrakeTable") = "Coil Brake" & "Hydraulic Brake"), false, true)

  • Suggested answer
    Community Member Profile Picture
    on at

    Replace "&" with "AND" in your expression.

  • Community Member Profile Picture
    on at

    Hi all,

    Thanks for your kind suggestions. I'm still having trouble. I've 3 groups on the a tablix.

    These 3 groups have a parameter called brake type. If parameter brake type = X then make group 1 visible & group 2 and 3 invisible.  Any expression where this scenario is possible? Also, what about the black space of invisible groups once the logic is triggered. Any help will be greatly appreciated. I can also provide screen shots if needed. Please let me know.

    Thank you!!

  • Community Member Profile Picture
    on at

    Hi!! you can try:

    =IIF((First(Fields!Mag_BrakeTypes.Value, "Mag_BrakeTable") = "Thruster Brake" Or First(Fields!Mag_BrakeTypes.Value, "Mag_BrakeTable") = "Coil Brake"), false, true)

    one cuestion, why use first? is only one cell or columns?

  • Community Member Profile Picture
    on at

    Hello Roberto,

    Tried this and it didn't work. However, if I break this expression into two separate ones and place them into separate rectangles or groups then it works but it still doesn't make any sense. It hides both of them. My goal is to hide only one or the other. I'm thinking about writing classes that might manipulate this logic. Any suggestions?

  • Community Member Profile Picture
    on at

    Hi, I feel confuse with your question and your code...

    Logic:

    If brake type is "Thruster Brake" then hide Coil Brake rectangle and Hyraulic Brake rectangle.

    Expression :

    =IIF((First(Fields!Mag_BrakeTypes.Value, "Mag_BrakeTable") = "Coil Brake" & "Hydraulic Brake"), false, true)

    You need to hide Coil Brake and Hyraulic Brake if Brake Type is "Thruster Brake", but in your code, you didn't check "Thruster Brake". Is it should be something like this??

    =IIF((First(Fields!Mag_BrakeTypes.Value, "Mag_BrakeTable") = "Thruster Brake"), false, true)

    And then put this code in both Coil Brake rectangle and Hyraulic Brake rectangle??


    PS: Please note "false" mean visible, "true" mean hidden.

  • Community Member Profile Picture
    on at

    Hello,

    What if I want to hide Coil brake and make other two visible?  How do I write OrElse expression in this case? I'm a newbie in developing SSRS reports.

    Thank you!

  • Martin Dráb Profile Picture
    239,036 Most Valuable Professional on at

    It's easier than you think, because you're trying to add things that shouldn't be there.

    Write an expression for each of these controls individually and set Hidden to Fields!Mag_BrakeTypes.Value = "Mag_BrakeTable" or Fields!Mag_BrakeTypes.Value <> "Mag_BrakeTable", depending on the required behavior.

  • Community Member Profile Picture
    on at

    How do I write two expressions together? Does this make any sense? Please help.

    =IIF(Fields!Mag_BrakeTypes.Value, "Mag_BrakeTabe") = "Coil Brake") and Fields!Mag_BrakeTypes.Value, "Mag_BrakeTable" = "Hydraulic Brake"), false, true)

    Thanks!

  • Community Member Profile Picture
    on at

    Please refer to following expressions:

    Thruster rectangle

    =IIF((Fields!Mag_BrakeTypes.Value = "Coil Brake" OR Fields!Mag_BrakeTypes.Value = "Hydraulic Brake"), false, true)

    Coil rectangle

    =IIF((Fields!Mag_BrakeTypes.Value = "Thruster Brake" OR Fields!Mag_BrakeTypes.Value = "Hydraulic Brake"), false, true)

    Hydraulic rectangle

    =IIF((Fields!Mag_BrakeTypes.Value = "Coil Brake" OR Fields!Mag_BrakeTypes.Value = "Thruster Brake"), false, true)

    This is super weird. It hides all 3 rectangles. I'm not sure what I'm doing wrong. Any help will be greatly appreciated!

    Thank you!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans