Exemplo n.º 1
0
        /// <summary>
        /// Adds client total calculator that produces sum amount of supplied row values
        /// </summary>
        /// <param name="conf">Configuration</param>
        /// <param name="name">Name of field to be added to existing ResponseInfo template model</param>
        /// <param name="sumExpression">`{@}`-syntax expression that will be calculated for each row and summarized</param>
        /// <param name="clientDataSet">Client data set to perform calculations on</param>
        /// <returns></returns>
        public static PluginConfigurationWrapper <ResponseInfoClientConfiguration> AddClientSum(
            this PluginConfigurationWrapper <ResponseInfoClientConfiguration> conf,
            string name,
            string sumExpression,
            ClientDataSet clientDataSet
            )
        {
            var function = TotalClientFunctionsExtensions.CreateSumFunction(sumExpression, clientDataSet);

            conf.Configuration.ClientCalculators.Add(name, new JRaw(function));
            return(conf);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds client total calculator that produces count of rows that match supplied predicate function
        /// </summary>
        /// <param name="conf">Configuration</param>
        /// <param name="name">Name of field to be added to existing ResponseInfo template model</param>
        /// <param name="predicate">`{@}`-syntax expression that specifies predicate</param>
        /// <param name="clientDataSet">Client data set to perform calculations on</param>
        /// <returns></returns>
        public static PluginConfigurationWrapper <ResponseInfoClientConfiguration> AddClientCountPredicate(
            this PluginConfigurationWrapper <ResponseInfoClientConfiguration> conf,
            string name,
            string predicate,
            ClientDataSet clientDataSet

            )
        {
            var function = TotalClientFunctionsExtensions.CreateSumFunctionWithPredicate("1", predicate, clientDataSet);

            conf.Configuration.ClientCalculators.Add(name, new JRaw(function));
            return(conf);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Adds client total calculator that produces weighted average of supplied row values
        /// </summary>
        /// <param name="conf">Configuration</param>
        /// <param name="name">Name of field to be added to existing ResponseInfo template model</param>
        /// <param name="avgExpression">`{@}`-syntax expression that will be calculated for each row and averaged</param>
        /// <param name="weightExpression">`{@}`-syntax expression for weight coefficient</param>
        /// <param name="clientDataSet">Client data set to perform calculations on</param>
        /// <returns></returns>
        public static PluginConfigurationWrapper <ResponseInfoClientConfiguration> AddClientWeightedAverage(
            this PluginConfigurationWrapper <ResponseInfoClientConfiguration> conf,
            string name,
            string avgExpression,
            string weightExpression,
            ClientDataSet clientDataSet

            )
        {
            var function = TotalClientFunctionsExtensions.CreateWeightedAvgFunction(avgExpression, weightExpression, clientDataSet);

            conf.Configuration.ClientCalculators.Add(name, new JRaw(function));
            return(conf);
        }