How do I set a default value for a multi-value parameter using an expression?

5 posts, 0 answers
  1. Wayde
    Wayde avatar
    10 posts
    Member since:
    Dec 2011

    Posted 16 Dec 2011 Link to this post

    Following the documentation here:

    It says, "In order to have multiple values selected, you should set the Value property of the parameter to an IEnumerable instance containing the desired values. This can be done using the code behind or an expression."

    My question is:  How do you specify one or more default values using an "expression"?

    Thanks - Wayde
  2. Elian
    Elian avatar
    435 posts

    Posted 19 Dec 2011 Link to this post

    Hi Wayde,

    If you use SqlDataSource and follow the documentation step by step (all requirements are satisfied), then you create the aggregate function as shown in the example (may want to change the logic there, which parameters should be selected, as the example selects all).
    And then the expression would be Value = AllValues(Fields.YourField). See attached screenshot for more info.

    If you are using objectDataSource then you can bind to custom user function that returns an array of data.

    Kind regards,
    the Telerik team

    Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

  3. Wayde
    Wayde avatar
    10 posts
    Member since:
    Dec 2011

    Posted 20 Dec 2011 Link to this post

    Thanks for the info.  Reviewed the documentation and figured out what I was missing.

    As a side note, it would be nice to simply have an option in the designer to have the "<select all>" option in a multi-value parameter set as the default. Using the example it sets it and all other values which is redundant and potentially confusing to end users.

    Thanks - Wayde
  4. Hardik
    Hardik avatar
    10 posts
    Member since:
    Jan 2015

    Posted 16 Jan 2015 Link to this post

    I am using standalone telerik report designer Q3 2014. I can't see the function =AllValues.

    Could you please advise how can I select multiple values as default? I tried aggregrate function First(),Join() but these functions did not work.

  5. KS
    KS avatar
    165 posts
    Member since:
    Oct 2012

    Posted 20 Jan 2015 in reply to Hardik Link to this post


    Check this - Using Multivalue Parameters. And to use user functions in the Standalone Designer - Extending Report Designer.

Back to Top