Exemple #1
0
        /// <summary>
        /// calculate the next level deeper
        /// </summary>
        /// <param name="rptLowerLevel"></param>
        /// <param name="masterRow"></param>
        public void Calculate(TRptLowerLevel rptLowerLevel, int masterRow)
        {
            TRptDataCalcLevel rptDataCalcLevel;
            TRptCalculation rptCalculation;
            TRptDataCalcCalculation rptDataCalcCalculation;
            TRptDataCalcParameter rptDataCalcParameter;

            if (!EvaluateCondition(rptLowerLevel.strCondition))
            {
                return;
            }

            if (rptLowerLevel.rptGrpParameter != null)
            {
                rptDataCalcParameter = new TRptDataCalcParameter(this);
                rptDataCalcParameter.Calculate("", rptLowerLevel.rptGrpParameter);
            }

            if (rptLowerLevel.strCalculation.Length == 0)
            {
                rptDataCalcLevel = new TRptDataCalcLevel(this);
                rptDataCalcLevel.Depth++;
                rptDataCalcLevel.Calculate(CurrentReport.GetLevel(rptLowerLevel.strLevel), masterRow);
            }
            else
            {
                rptCalculation = ReportStore.GetCalculation(CurrentReport, rptLowerLevel.strCalculation);

                if (rptCalculation == null)
                {
                    TLogging.Log("calculation not found:" + rptLowerLevel.strCalculation);
                    return;
                }

                rptDataCalcCalculation = new TRptDataCalcCalculation(this);

                rptDataCalcCalculation.EvaluateCalculation(rptCalculation, rptLowerLevel.rptGrpParameter, rptLowerLevel.strLevel, masterRow);
            }
        }
Exemple #2
0
        /// <summary>
        /// todoComment
        /// </summary>
        /// <param name="rptGrpParameter"></param>
        /// <param name="query"></param>
        /// <returns></returns>
        private string ApplyParametersToQuery(List <TRptParameter>rptGrpParameter, String query)
        {
            string ReturnValue;
            TRptDataCalcParameter rptDataCalcParameter;

            ReturnValue = query;

            if (rptGrpParameter != null)
            {
                rptDataCalcParameter = new TRptDataCalcParameter(this);
                ReturnValue = rptDataCalcParameter.Calculate(ReturnValue, rptGrpParameter);
            }

            return ReturnValue;
        }