Example #1
0
        internal void DoneReadingRows(ref Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObjResult[] runningValueValues, ref Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObjResult[] runningValueOfAggregateValues, ref Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObjResult[] cellRunningValueValues)
        {
            AggregatesImpl aggregatesImpl = m_odpContext.ReportObjectModel.AggregatesImpl;

            RuntimeRICollection.StoreRunningValues(aggregatesImpl, m_hierarchyDef.RunningValues, ref runningValueValues);
            if (m_hierarchyDef.DataScopeInfo != null)
            {
                RuntimeRICollection.StoreRunningValues(aggregatesImpl, m_hierarchyDef.DataScopeInfo.RunningValuesOfAggregates, ref runningValueOfAggregateValues);
            }
            int num  = (m_staticCellPreviousValues != null) ? m_staticCellPreviousValues.Count : 0;
            int num2 = (m_staticCellRVs != null) ? m_staticCellRVs.Count : 0;

            if (num2 > 0)
            {
                cellRunningValueValues = new Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObjResult[num2 + num];
                for (int i = 0; i < num2; i++)
                {
                    Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj aggregateObj = aggregatesImpl.GetAggregateObj(m_staticCellRVs[i]);
                    cellRunningValueValues[i] = aggregateObj.AggregateResult();
                }
            }
            if (num > 0)
            {
                if (cellRunningValueValues == null)
                {
                    cellRunningValueValues = new Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObjResult[num];
                }
                for (int j = 0; j < num; j++)
                {
                    Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj aggregateObj2 = aggregatesImpl.GetAggregateObj(m_staticCellPreviousValues[j]);
                    cellRunningValueValues[num2 + j] = aggregateObj2.AggregateResult();
                }
            }
        }
 internal static void StoreRunningValues(AggregatesImpl globalRVCol, List <Microsoft.ReportingServices.ReportIntermediateFormat.RunningValueInfo> runningValues, ref Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObjResult[] runningValueValues)
 {
     if (runningValues != null && 0 < runningValues.Count)
     {
         if (runningValueValues == null)
         {
             runningValueValues = new Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObjResult[runningValues.Count];
         }
         for (int i = 0; i < runningValues.Count; i++)
         {
             Microsoft.ReportingServices.ReportIntermediateFormat.RunningValueInfo runningValueInfo = runningValues[i];
             Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj aggregateObj     = globalRVCol.GetAggregateObj(runningValueInfo.Name);
             if (aggregateObj != null)
             {
                 runningValueValues[i] = aggregateObj.AggregateResult();
             }
         }
     }
     else
     {
         runningValueValues = null;
     }
 }
 protected void SetupAggregates(List <Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj> aggregates)
 {
     if (aggregates != null)
     {
         for (int i = 0; i < aggregates.Count; i++)
         {
             Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj dataAggregateObj = aggregates[i];
             m_odpContext.ReportObjectModel.AggregatesImpl.Set(dataAggregateObj.Name, dataAggregateObj.AggregateDef, dataAggregateObj.DuplicateNames, dataAggregateObj.AggregateResult());
         }
     }
 }
 internal static void UpdateAggregates(OnDemandProcessingContext odpContext, List <Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj> aggregates, bool updateAndSetup)
 {
     if (aggregates == null)
     {
         return;
     }
     for (int i = 0; i < aggregates.Count; i++)
     {
         Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj dataAggregateObj = aggregates[i];
         dataAggregateObj.Update();
         if (updateAndSetup)
         {
             odpContext.ReportObjectModel.AggregatesImpl.Set(dataAggregateObj.Name, dataAggregateObj.AggregateDef, dataAggregateObj.DuplicateNames, dataAggregateObj.AggregateResult());
         }
     }
 }
Example #5
0
 private object GetAggregateValue(string key, Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj aggregateObj)
 {
     aggregateObj.UsedInExpression = true;
     Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObjResult dataAggregateObjResult = aggregateObj.AggregateResult();
     if (dataAggregateObjResult == null)
     {
         Global.Tracer.Assert(m_odpContext.IsTablixProcessingMode, "Missing aggregate result outside of tablix processing");
         throw new ReportProcessingException_MissingAggregateDependency();
     }
     if (dataAggregateObjResult.HasCode)
     {
         if ((dataAggregateObjResult.FieldStatus == DataFieldStatus.None || dataAggregateObjResult.FieldStatus == DataFieldStatus.IsError) && dataAggregateObjResult.Code != 0)
         {
             ErrorContext.Register(dataAggregateObjResult.Code, dataAggregateObjResult.Severity, dataAggregateObjResult.Arguments);
         }
         else if (dataAggregateObjResult.FieldStatus == DataFieldStatus.UnSupportedDataType)
         {
             ErrorContext.Register(ProcessingErrorCode.rsAggregateOfInvalidExpressionDataType, Severity.Warning, dataAggregateObjResult.Arguments);
         }
         if (dataAggregateObjResult.ErrorOccurred)
         {
             throw new ReportProcessingException_InvalidOperationException();
         }
     }
     if (dataAggregateObjResult.ErrorOccurred)
     {
         throw new ReportProcessingException(ErrorCode.rsInvalidOperation);
     }
     return(dataAggregateObjResult.Value);
 }