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

Telerik Aggregate function in code behind

1 Answer 84 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sobiya
Top achievements
Rank 1
Sobiya asked on 30 Jan 2013, 10:16 AM
Hi,

I am working on telerik reports and used a function for selecting all values by default
for multivalue parameter, i am using value in parameter like 'AllValues(Parameters.ParameterName.Value)',
and function is written in report code behind as-

[AggregateFunction(Description = "Collects all values", Name = "AllValues")]
        public class AllValuesAggregateFunction : IAggregateFunction
        {
            ArrayList values;

            public void Accumulate(object[] values)
            {
                var value = values[0];
                this.values.Add(value);
            }

            public object GetValue()
            {
                return this.values;
            }

            public void Init()
            {
                this.values = new ArrayList();
            }

            public void Merge(IAggregateFunction aggregateFunction)
            {
                var otherFunction = (AllValuesAggregateFunction)aggregateFunction;
                this.values.AddRange(otherFunction.values);
            }
        }

now i have some parameters which are added from code , how can i use this function for those parameters
this.ReportParameters["Department"].Value= ??


1 Answer, 1 is accepted

Sort by
0
Hadib Ahmabi
Top achievements
Rank 1
answered on 01 Feb 2013, 10:54 AM
I guess you can use the same expression:
this.ReportParameters["Department"].Value= "AllValues(Parameters.ParameterName.Value)";

or you can directly assign the collection of the real parameter values 
this.ReportParameters["Department"].Value= DepartamentParameterValuesList; //this is some collection of the actual values
Tags
General Discussions
Asked by
Sobiya
Top achievements
Rank 1
Answers by
Hadib Ahmabi
Top achievements
Rank 1
Share this question
or