Esempio n. 1
0
        internal override void Update(object[] expressions, IErrorContext iErrorContext)
        {
            Global.Tracer.Assert(expressions != null);
            Global.Tracer.Assert(1 == expressions.Length);
            object       doubleOrDecimalData = expressions[0];
            DataTypeCode doubleOrDecimalType = DataAggregate.GetTypeCode(doubleOrDecimalData);

            if (!DataAggregate.IsNull(doubleOrDecimalType))
            {
                if (!DataTypeUtility.IsNumeric(doubleOrDecimalType))
                {
                    iErrorContext.Register(ProcessingErrorCode.rsAggregateOfNonNumericData, Severity.Warning);
                    throw new InvalidOperationException();
                }
                if (m_expressionType == DataTypeCode.Null)
                {
                    m_expressionType = doubleOrDecimalType;
                }
                else if (doubleOrDecimalType != m_expressionType)
                {
                    iErrorContext.Register(ProcessingErrorCode.rsAggregateOfMixedDataTypes, Severity.Warning);
                    throw new InvalidOperationException();
                }
                DataAggregate.ConvertToDoubleOrDecimal(doubleOrDecimalType, doubleOrDecimalData, out doubleOrDecimalType, out doubleOrDecimalData);
                if (m_currentTotal == null)
                {
                    m_currentTotalType = doubleOrDecimalType;
                    m_currentTotal     = doubleOrDecimalData;
                }
                else
                {
                    m_currentTotal = DataAggregate.Add(m_currentTotalType, m_currentTotal, doubleOrDecimalType, doubleOrDecimalData);
                }
            }
        }
Esempio n. 2
0
 internal override void Update(object[] expressions, IErrorContext iErrorContext)
 {
     Global.Tracer.Assert(expressions != null);
     Global.Tracer.Assert(1 == expressions.Length);
     if (!DataAggregate.IsNull(DataAggregate.GetTypeCode(expressions[0])))
     {
         base.Update(expressions, iErrorContext);
         m_currentCount++;
     }
 }
Esempio n. 3
0
        internal override void Update(object[] expressions, IErrorContext iErrorContext)
        {
            Global.Tracer.Assert(expressions != null);
            Global.Tracer.Assert(1 == expressions.Length);
            object       obj      = expressions[0];
            DataTypeCode typeCode = DataAggregate.GetTypeCode(obj);

            if (DataAggregate.IsNull(typeCode))
            {
                return;
            }
            if (!DataAggregate.IsVariant(typeCode))
            {
                iErrorContext.Register(ProcessingErrorCode.rsMinMaxOfNonSortableData, Severity.Warning);
                throw new InvalidOperationException();
            }
            if (m_expressionType == DataTypeCode.Null)
            {
                m_expressionType = typeCode;
            }
            else if (typeCode != m_expressionType)
            {
                iErrorContext.Register(ProcessingErrorCode.rsAggregateOfMixedDataTypes, Severity.Warning);
                throw new InvalidOperationException();
            }
            if (m_currentMin == null)
            {
                m_currentMin = obj;
                return;
            }
            try
            {
                if (ReportProcessing.CompareTo(m_currentMin, obj, m_compareInfo, m_compareOptions) > 0)
                {
                    m_currentMin = obj;
                }
            }
            catch
            {
                iErrorContext.Register(ProcessingErrorCode.rsMinMaxOfNonSortableData, Severity.Warning);
            }
        }
        internal override void Update(object[] expressions, IErrorContext iErrorContext)
        {
            Global.Tracer.Assert(expressions != null);
            Global.Tracer.Assert(1 == expressions.Length);
            object       obj      = expressions[0];
            DataTypeCode typeCode = DataAggregate.GetTypeCode(obj);

            if (!DataAggregate.IsNull(typeCode))
            {
                if (!DataAggregate.IsVariant(typeCode))
                {
                    iErrorContext.Register(ProcessingErrorCode.rsInvalidExpressionDataType, Severity.Warning);
                    throw new InvalidOperationException();
                }
                if (!m_distinctValues.ContainsKey(obj))
                {
                    m_distinctValues.Add(obj, null);
                }
            }
        }