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

default values in Telerik Report parameter

3 Answers 301 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gaurav
Top achievements
Rank 1
Gaurav asked on 08 Apr 2015, 07:50 AM

Hi,

 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

Sort by
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.

For more details, please check the Using Multivalue Parameters article.


I hope the provided information is helpful.

Regards,
Stef
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Gaurav
Top achievements
Rank 1
answered on 10 Apr 2015, 10:00 AM
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.

Thank you for your understanding.

Regards,
Stef
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
General Discussions
Asked by
Gaurav
Top achievements
Rank 1
Answers by
Stef
Telerik team
Gaurav
Top achievements
Rank 1
Share this question
or