I have a multivalue parameter in my telerik report and i want to set three values as default, how can i achieve this. I know how to set All values and single value as default but i want it for three values.
Thanks,
Gaurav
3 Answers, 1 is accepted
0
Stef
Telerik team
answered on 09 Apr 2015, 01:57 PM
Hello Gaurav,
You can use an aggregate function similar to the AllValues sample function to get only the needed initial values. If the values are known, you can use directly the Array utility function.
I am using Q1 2013 and it does not support Array() function. Whats the alternative of it in Q1 2013?
0
Stef
Telerik team
answered on 10 Apr 2015, 12:26 PM
Hi Gaurav,
Below is a quote from my response in your support ticket on the same question:
"You can use an aggregate function similar to the AllValues example, which collects only specific values based on your requirements. For example, we modified the AllValues custom aggregate to returns only the first 3 values from the whole parameter's available values list:
public class First3ValuesAggregateFunction : IAggregateFunction
{
ArrayList values;
public void Accumulate(object[] values)
{
var value = values[0];
if (this.values.Count < 3)
this.values.Add(value);
}
public object GetValue()
{
return this.values;
}
public void Init()
{
this.values = new ArrayList();
}
public void Merge(IAggregateFunction aggregateFunction)
{
var otherFunction = (First3ValuesAggregateFunction )aggregateFunction;
this.values.AddRange(otherFunction.values);
}
}
"
If you need further help, please let us continue the discussion in only one of the threads. Thus we can keep a better track on the exchanged information and the progress of the issue.