示例#1
0
        public override void Deserialize(IntermediateFormatReader reader)
        {
            reader.RegisterDeclaration(m_declaration);
            while (reader.NextMember())
            {
                switch (reader.CurrentMember.MemberName)
                {
                case MemberName.ExpressionType:
                    m_expressionType = (Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode)reader.ReadEnum();
                    break;

                case MemberName.CurrentCount:
                    m_currentCount = reader.ReadUInt32();
                    break;

                case MemberName.SumOfXType:
                    m_sumOfXType = (Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode)reader.ReadEnum();
                    break;

                case MemberName.SumOfX:
                    m_sumOfX = reader.ReadVariant();
                    break;

                case MemberName.SumOfXSquared:
                    m_sumOfXSquared = reader.ReadVariant();
                    break;

                default:
                    Global.Tracer.Assert(condition: false);
                    break;
                }
            }
        }
示例#2
0
        public override void Deserialize(IntermediateFormatReader reader)
        {
            reader.RegisterDeclaration(m_declaration);
            IScalabilityCache scalabilityCache = reader.PersistenceHelper as IScalabilityCache;

            while (reader.NextMember())
            {
                switch (reader.CurrentMember.MemberName)
                {
                case MemberName.ExpressionType:
                    m_expressionType = (Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode)reader.ReadEnum();
                    break;

                case MemberName.CurrentMin:
                    m_currentMin = reader.ReadVariant();
                    break;

                case MemberName.Comparer:
                {
                    int id = reader.ReadInt32();
                    m_comparer = (Microsoft.ReportingServices.ReportProcessing.ReportProcessing.ProcessingComparer)scalabilityCache.FetchStaticReference(id);
                    break;
                }

                default:
                    Global.Tracer.Assert(condition: false);
                    break;
                }
            }
        }
示例#3
0
        internal override void Update(object[] expressions, IErrorContext iErrorContext)
        {
            //IL_0096: Unknown result type (might be due to invalid IL or missing references)
            //IL_009c: Unknown result type (might be due to invalid IL or missing references)
            //IL_00a6: Expected O, but got Unknown
            //IL_00b3: Unknown result type (might be due to invalid IL or missing references)
            //IL_00b9: Unknown result type (might be due to invalid IL or missing references)
            //IL_00c3: Expected O, but got Unknown
            object obj = expressions[0];

            Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode typeCode = DataAggregate.GetTypeCode(obj);
            if (!DataAggregate.IsNull(typeCode))
            {
                if (!DataTypeUtility.IsSpatial(typeCode))
                {
                    iErrorContext.Register(ProcessingErrorCode.rsUnionOfNonSpatialData, Severity.Warning);
                    throw new ReportProcessingException(ErrorCode.rsInvalidOperation);
                }
                if (m_expressionType == Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode.Null)
                {
                    m_expressionType = typeCode;
                }
                else if (typeCode != m_expressionType)
                {
                    iErrorContext.Register(ProcessingErrorCode.rsUnionOfMixedSpatialTypes, Severity.Warning);
                    throw new ReportProcessingException(ErrorCode.rsInvalidOperation);
                }
                if (m_currentUnion == null)
                {
                    m_expressionType = typeCode;
                    m_currentUnion   = obj;
                }
            }
        }
示例#4
0
 internal override void Init()
 {
     m_currentCount  = 0u;
     m_sumOfXType    = Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode.Null;
     m_sumOfX        = null;
     m_sumOfXSquared = null;
 }
示例#5
0
        internal override void Update(object[] expressions, IErrorContext iErrorContext)
        {
            object doubleOrDecimalData = expressions[0];

            Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode doubleOrDecimalType = DataAggregate.GetTypeCode(doubleOrDecimalData);
            if (!DataAggregate.IsNull(doubleOrDecimalType))
            {
                if (!DataTypeUtility.IsNumeric(doubleOrDecimalType))
                {
                    iErrorContext.Register(ProcessingErrorCode.rsAggregateOfNonNumericData, Severity.Warning);
                    throw new ReportProcessingException(ErrorCode.rsInvalidOperation);
                }
                DataAggregate.ConvertToDoubleOrDecimal(doubleOrDecimalType, doubleOrDecimalData, out doubleOrDecimalType, out doubleOrDecimalData);
                if (m_expressionType == Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode.Null)
                {
                    m_expressionType = doubleOrDecimalType;
                }
                else if (doubleOrDecimalType != m_expressionType)
                {
                    iErrorContext.Register(ProcessingErrorCode.rsAggregateOfMixedDataTypes, Severity.Warning);
                    throw new ReportProcessingException(ErrorCode.rsInvalidOperation);
                }
                if (m_currentTotal == null)
                {
                    m_currentTotalType = doubleOrDecimalType;
                    m_currentTotal     = doubleOrDecimalData;
                }
                else
                {
                    m_currentTotal = DataAggregate.Add(m_currentTotalType, m_currentTotal, doubleOrDecimalType, doubleOrDecimalData);
                }
            }
        }
 protected static object Square(Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode xType, object x)
 {
     if (Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode.Double == xType)
     {
         return((double)x * (double)x);
     }
     if (Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode.Decimal == xType)
     {
         return((decimal)x * (decimal)x);
     }
     Global.Tracer.Assert(condition: false);
     throw new ReportProcessingException(ErrorCode.rsInvalidOperation);
 }
 protected static void ConvertToDoubleOrDecimal(Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode numericType, object numericData, out Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode doubleOrDecimalType, out object doubleOrDecimalData)
 {
     if (Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode.Decimal == numericType)
     {
         doubleOrDecimalType = Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode.Decimal;
         doubleOrDecimalData = numericData;
     }
     else
     {
         doubleOrDecimalType = Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode.Double;
         doubleOrDecimalData = DataTypeUtility.ConvertToDouble(numericType, numericData);
     }
 }
        internal override void Update(object[] expressions, IErrorContext iErrorContext)
        {
            object obj = expressions[0];

            Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode typeCode = DataAggregate.GetTypeCode(obj);
            if (!DataAggregate.IsNull(typeCode))
            {
                if (!DataAggregate.IsVariant(typeCode) || DataTypeUtility.IsSpatial(typeCode))
                {
                    iErrorContext.Register(ProcessingErrorCode.rsInvalidExpressionDataType, Severity.Warning);
                    throw new ReportProcessingException(ErrorCode.rsInvalidOperation);
                }
                if (!m_distinctValues.ContainsKey(obj))
                {
                    m_distinctValues.Add(obj, null);
                }
            }
        }
示例#9
0
        internal override void Update(object[] expressions, IErrorContext iErrorContext)
        {
            object obj = expressions[0];

            Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode typeCode = DataAggregate.GetTypeCode(obj);
            if (DataAggregate.IsNull(typeCode))
            {
                return;
            }
            if (!DataAggregate.IsVariant(typeCode) || DataTypeUtility.IsSpatial(typeCode))
            {
                iErrorContext.Register(ProcessingErrorCode.rsMinMaxOfNonSortableData, Severity.Warning);
                throw new ReportProcessingException(ErrorCode.rsInvalidOperation);
            }
            if (m_currentMin == null)
            {
                m_currentMin     = obj;
                m_expressionType = typeCode;
                return;
            }
            bool validComparisonResult;
            int  num = m_comparer.Compare(m_currentMin, obj, throwExceptionOnComparisonFailure: false, extendedTypeComparisons: false, out validComparisonResult);

            if (!validComparisonResult)
            {
                if (typeCode != m_expressionType)
                {
                    iErrorContext.Register(ProcessingErrorCode.rsAggregateOfMixedDataTypes, Severity.Warning);
                    throw new ReportProcessingException(ErrorCode.rsInvalidOperation);
                }
                iErrorContext.Register(ProcessingErrorCode.rsMinMaxOfNonSortableData, Severity.Warning);
            }
            else if (num > 0)
            {
                m_currentMin     = obj;
                m_expressionType = typeCode;
            }
        }
示例#10
0
 internal override void Init()
 {
     m_expressionType = Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode.Null;
     m_currentUnion   = null;
 }
 protected static bool IsVariant(Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode typeCode)
 {
     return(Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode.ByteArray != typeCode);
 }
 protected static bool IsNull(Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode typeCode)
 {
     return(typeCode == Microsoft.ReportingServices.ReportProcessing.DataAggregate.DataTypeCode.Null);
 }