This is a migrated thread and some comments may be shown as answers.

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

4 Answers 487 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Wayde
Top achievements
Rank 1
Wayde asked on 17 Dec 2011, 03:12 AM
Following the documentation here:
http://www.telerik.com/help/reporting/designing-reports-parameters-using-multivalue-parameter.html

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

4 Answers, 1 is accepted

Sort by
0
Elian
Telerik team
answered on 19 Dec 2011, 07:11 PM
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,
Elian
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!

0
Wayde
Top achievements
Rank 1
answered on 20 Dec 2011, 08:24 PM
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
0
Hardik
Top achievements
Rank 1
answered on 16 Jan 2015, 06:48 AM
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.

Thanks,
Hardik
0
KS
Top achievements
Rank 1
answered on 20 Jan 2015, 10:03 AM
Hi,

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

-KS
Tags
General Discussions
Asked by
Wayde
Top achievements
Rank 1
Answers by
Elian
Telerik team
Wayde
Top achievements
Rank 1
Hardik
Top achievements
Rank 1
KS
Top achievements
Rank 1
Share this question
or