default values in Telerik Report parameter

4 posts, 0 answers
  1. Gaurav
    Gaurav  avatar
    2 posts
    Member since:
    Oct 2014

    Posted 08 Apr 2015 Link to this post

    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

  2. Stef
    Admin
    Stef avatar
    3044 posts

    Posted 09 Apr 2015 Link to this post

    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.

     
  3. Gaurav
    Gaurav  avatar
    2 posts
    Member since:
    Oct 2014

    Posted 10 Apr 2015 in reply to Stef Link to this post

    I am using Q1 2013 and it does not support Array() function. Whats the alternative of it in Q1 2013?
  4. Stef
    Admin
    Stef avatar
    3044 posts

    Posted 10 Apr 2015 Link to this post

    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.

     
Back to Top