Count number of selected values in Multi Value Parameter

5 posts, 0 answers
  1. Kanchana
    Kanchana avatar
    14 posts
    Member since:
    May 2017

    Posted 08 Jun 2017 Link to this post

    Hi,

    Is there a way to count the number of selected values in a multi-valued report parameter? I know the result of a multi-valued parameter is an object array (Object[]) but I would like to know the number of items in the array. 

    Also, is there a way to know if  <select all> option is checked or unchecked, in other words if all values are selected or not?

     

    Thank you.

     

     

  2. Katia
    Admin
    Katia avatar
    693 posts

    Posted 09 Jun 2017 Link to this post

    Hi Kanchana,

    To count a number of values in multivalue parameter you can use the following expression in report:
    = Parameters.Parameter1.Value.Length

    To check if all values are selected compare the above value with parameter's AvailableValues.Count value:
    // returns true or false
    = Parameters.Parameter1.Value.Length = Parameters.Parameter1.AvailableValues.Count

    Hope this helps.


    Regards,
    Katia
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Kanchana
    Kanchana avatar
    14 posts
    Member since:
    May 2017

    Posted 09 Jun 2017 in reply to Katia Link to this post

    Worked like a wonder... Thank you.
  4. Phil
    Phil avatar
    44 posts
    Member since:
    Mar 2015

    Posted 28 Feb 2018 Link to this post

    Similar to this:

    Is there a property I can use to see which value(s) are selected?

    If I have selected 1 and 3 in the multi value parameter list...

    I would like to say If parameter.value.contains 1 then do this... if contains 2 then do this...

  5. Anthony
    Anthony avatar
    1 posts
    Member since:
    Jul 2019

    Posted 04 Jul in reply to Phil Link to this post

    Phil said:

    Similar to this:

    Is there a property I can use to see which value(s) are selected?

    If I have selected 1 and 3 in the multi value parameter list...

    I would like to say If parameter.value.contains 1 then do this... if contains 2 then do this...



    IIf (Parameters.Parameter1.Value.Lenght = 1, 'do this 1', IIF (Parameters.Parameter1.Value.Lenght = 2, 'do this 2', IIf (Parameters.Parameter1.Value.Lenght = 3, 'do this 3', 'then selection is either bigger than 3 or = 0')))

    Hope you find it useful!

Back to Top