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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

SSRS report Visual Studio 2010 multi-select value for IIF

(0) ShareShare
ReportReport
Posted on by 735

I need to create an SSRS report (RDP, Visual Studio 2010), and one of the parameter (PAR1) is multi-selected (let’s say Val1, Val2 (Val1 and Val2 = are enum)). I have 3 columns in my report (Col1, Col2, Col3).

The problem is that based on the value specified in my PAR1 (for example Val2), the columns Col2 and Col3 should be hidden). Otherwise – visible. If the customer have chosen Val1, Val2 - also all columns should be visible.

I have tried to write an expression in the Column Visibility property for Col2, like =IIF(Join(Parameters!Parameter.Label)<>"Val2EnumValue",true,false),

I also tried =IIF(Join(Parameters!Parameter.Value)<>"Val2EnumValue",true,false)

And =IIF(Join(Parameters!Parameter.Label(0))<>"Val2EnumValue",true,false)

And =IIF(Join(Parameters!Parameter.Value(0))<>"Val2EnumValue",true,false)

And many other specified here and here

but not succeed.

Any help would be very appreciated.

Oleksandr

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Ragoza,

    Try this out:

    IIF(Parameters!Parameter.value <> Fields!Val2EnumValue.value, false, true)...

    I guess the placement of "true" and "false" is wrong. Revert back with the result.

    Regards,

    Mriganka

  • Suggested answer
    dolee Profile Picture
    11,279 on at

    Hi Oleksandr,

    Let's say your enum is "NoYes". Then the expression should write:

    =Iif(Parameters!rdpReport_noYes.Value = "Yes",
    	 false,
    	 true)


    Then when the checkbox is unchecked, the control will be invisible.

  • Ragoza Oleksandr Profile Picture
    735 on at

    Hi Mriganka,

    Hi Dominic Lee

    Thank you for you inputs, but none of this variants haven’t solved my problem (maybe I misunderstood you), please see the following results:

    The name of my BaseEnum is “InsCategory”, which contains the following elements: Val1 [0], Val2 [1], Val3 [2] .

    FieldCategory – is the name of the field (which contains my BaseEnum -“InsCategory”) in my temp table. I was trying to replace  FieldCategory to FieldCategory1. The same result

    //-------------------------------------------------------------------------------

    In this case:

    =IIF(Parameters!Parameter.value <> Fields!Val2EnumValue.value, false, true)

    I’ve made the following expression

    1. =IIF(Parameters!DS_Category.Value<>Fields!FieldCategory.Value,false,true)

    Error1. The Hidden expression for the tablix ‘Tablix2’ contains an error: Overload resolution failed because no Public '<>' can be called with these arguments: 'Public Shared Operator <>(a As String, b As String) As Boolean': Argument matching parameter 'a' cannot convert from 'Object()' to 'String'.

    //-------------------------------------------------------------------------------

    2. =IIF(Parameters!DS_Category.Value<>Fields!Val2.Value,false,true)

    Error 2: Field token Fields! Val2.Value is invalid. Could not find the identifier.\SSRS Reports\Reports\Report

    //-------------------------------------------------------------------------------

    3. =IIF(Parameters!DS_Category.Value<>Fields!FieldCategory1.Value,false,true)

    Error3. The Hidden expression for the tablix ‘Tablix2’ contains an error: Overload resolution failed because no Public '<>' can be called with these arguments: 'Public Shared Operator <>(a As String, b As String) As Boolean': Argument matching parameter 'a' cannot convert from 'Object()' to 'String'.

    //-------------------------------------------------------------------------------

    In this case:

    =Iif(Parameters!rdpReport_noYes.Value = "Yes",false,true)

    4.

    =IIF(Parameters!DS_Category.Value<>"Val2",false,true)

    Error4. The Hidden expression for the tablix ‘Tablix2’ contains an error: Overload resolution failed because no Public '<>' can be called with these arguments: 'Public Shared Operator <>(a As String, b As String) As Boolean': Argument matching parameter 'a' cannot convert from 'Object()' to 'String'.

    //-------------------------------------------------------------------------------

    By the way, the #4 variant is valid, if for my “DS_Category” Parameter the property Multi Value = false, but in my case, this property Multi Value = true.

    Any other Idea?

  • Suggested answer
    dolee Profile Picture
    11,279 on at

    Hi Ragoza,

    Sorry I missed the multi-select requirement in your original post. However, you did mention "Enum". How is the setup of that parameter? (I am just curious)

    Back to your question, let's keep using the NoYes enum as example, then:

    =Iif(InStr(JOIN(Parameters!rdpReport_noYes.Value,","),"no"),
    	 true,
    	 false)

    The "Join" function create a comma separated string of the selected items. So if both yes and no are selected, the result is "no,yes". Then, the inStr function is used to check if "no" exists in the string. The Hidden property value is then set accordingly.

    (Note that it is the "value" that get used to build to string)

  • Ragoza Oleksandr Profile Picture
    735 on at

    Hi Dominic,

    Thank you, now it's working,

    Oleksandr

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans