Example #1
0
 public FieldImpl(ObjectModelImpl reportOM, DataFieldStatus status, string exceptionMessage, AspNetCore.ReportingServices.ReportIntermediateFormat.Field fieldDef)
 {
     this.m_reportOM = reportOM;
     this.m_fieldDef = fieldDef;
     Global.Tracer.Assert(DataFieldStatus.None != status, "(DataFieldStatus.None != status)");
     this.UpdateValue(null, false, status, exceptionMessage);
 }
 private void ReadExtendedPropertiesForRecordField(int fieldIndex, AspNetCore.ReportingServices.ReportIntermediateFormat.Field fieldDef, AspNetCore.ReportingServices.ReportIntermediateFormat.RecordField field)
 {
     if (this.m_dataReader.ReaderFieldProperties && this.m_dataSetInstance.GetFieldPropertyCount(fieldIndex) > 0)
     {
         FieldInfo orCreateFieldInfo = this.m_dataSetInstance.GetOrCreateFieldInfo(fieldIndex);
         field.FieldPropertyValues = new List <object>(orCreateFieldInfo.PropertyCount);
         for (int i = 0; i < orCreateFieldInfo.PropertyCount; i++)
         {
             int    propertyIndex = orCreateFieldInfo.PropertyReaderIndices[i];
             string modelInfo     = orCreateFieldInfo.PropertyNames[i];
             try
             {
                 object propertyValue = this.m_dataReader.GetPropertyValue(fieldIndex, propertyIndex);
                 field.FieldPropertyValues.Add(propertyValue);
             }
             catch (ReportProcessingException_FieldError reportProcessingException_FieldError)
             {
                 if (!orCreateFieldInfo.IsPropertyErrorRegistered(i))
                 {
                     base.m_odpContext.ErrorContext.Register(ProcessingErrorCode.rsErrorReadingFieldProperty, Severity.Warning, AspNetCore.ReportingServices.ReportProcessing.ObjectType.DataSet, base.m_dataSet.Name, "FieldExtendedProperty", fieldDef.Name.MarkAsModelInfo(), modelInfo.MarkAsModelInfo(), reportProcessingException_FieldError.Message);
                     orCreateFieldInfo.SetPropertyErrorRegistered(i);
                 }
                 field.FieldPropertyValues.Add(null);
             }
         }
     }
 }
Example #3
0
        public void SetFields(FieldImpl[] fields, long streamOffset)
        {
            bool flag = this.m_referenced || streamOffset == DataFieldRow.UnInitializedStreamOffset || this.m_streamOffset != streamOffset;

            this.NewRow(streamOffset);
            if (this.m_collection == null)
            {
                Global.Tracer.Assert(false, "Invalid FieldsImpl.  m_collection should not be null.");
            }
            if (fields == null)
            {
                for (int i = 0; i < this.m_count; i++)
                {
                    FieldImpl fieldImpl = this.m_collection[i];
                    AspNetCore.ReportingServices.ReportIntermediateFormat.Field fieldDef = (fieldImpl == null) ? null : fieldImpl.FieldDef;
                    this.m_collection[i] = new FieldImpl(this.m_reportOM, null, false, fieldDef);
                }
            }
            else if (flag)
            {
                if (fields.Length != this.m_count)
                {
                    Global.Tracer.Assert(false, "Wrong number of fields during ReportOM update.  Usually this means the data set is wrong.  Expected: {0}.  Actual: {1}", this.m_count, fields.Length);
                }
                for (int j = 0; j < this.m_count; j++)
                {
                    this.m_collection[j] = fields[j];
                }
                this.m_isAggregateRow        = false;
                this.m_aggregationFieldCount = this.m_aggregationFieldCountForDetailRow;
            }
        }
Example #4
0
        public void Deserialize(IntermediateFormatReader reader)
        {
            reader.RegisterDeclaration(FieldImpl.m_declaration);
            IScalabilityCache scalabilityCache = reader.PersistenceHelper as IScalabilityCache;

            while (reader.NextMember())
            {
                switch (reader.CurrentMember.MemberName)
                {
                case MemberName.ReportObjectModel:
                {
                    int id2 = reader.ReadInt32();
                    this.m_reportOM = (ObjectModelImpl)scalabilityCache.FetchStaticReference(id2);
                    break;
                }

                case MemberName.Value:
                    this.m_value = reader.ReadVariant();
                    break;

                case MemberName.IsAggregateField:
                    this.m_isAggregationField = reader.ReadBoolean();
                    break;

                case MemberName.AggregationFieldChecked:
                    this.m_aggregationFieldChecked = reader.ReadBoolean();
                    break;

                case MemberName.FieldStatus:
                    this.m_fieldStatus = (DataFieldStatus)reader.ReadEnum();
                    break;

                case MemberName.Message:
                    this.m_exceptionMessage = reader.ReadString();
                    break;

                case MemberName.Properties:
                    this.m_properties = reader.ReadStringObjectHashtable <Hashtable>();
                    break;

                case MemberName.FieldDef:
                {
                    int id = reader.ReadInt32();
                    this.m_fieldDef = (AspNetCore.ReportingServices.ReportIntermediateFormat.Field)scalabilityCache.FetchStaticReference(id);
                    break;
                }

                case MemberName.UsedInExpression:
                    this.m_usedInExpression = reader.ReadBoolean();
                    break;

                default:
                    Global.Tracer.Assert(false);
                    break;
                }
            }
        }
Example #5
0
        public override List <ScopeValueFieldName> GetScopeValueFieldNameCollection(AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet dataSet)
        {
            List <ScopeValueFieldName> list = new List <ScopeValueFieldName>();

            for (int i = 0; i < this.m_expressions.Length; i++)
            {
                AspNetCore.ReportingServices.ReportIntermediateFormat.Field field = dataSet.Fields[this.m_expressions[i].FieldIndex];
                string dataField = field.DataField;
                list.Add(new ScopeValueFieldName(dataField, this.m_values[i].Value));
            }
            return(list);
        }
        void IPersistable.Deserialize(IntermediateFormatReader reader)
        {
            reader.RegisterDeclaration(CalculatedFieldWrapperImpl.m_declaration);
            IScalabilityCache scalabilityCache = reader.PersistenceHelper as IScalabilityCache;

            while (reader.NextMember())
            {
                switch (reader.CurrentMember.MemberName)
                {
                case MemberName.FieldDef:
                {
                    int id2 = reader.ReadInt32();
                    this.m_fieldDef = (AspNetCore.ReportingServices.ReportIntermediateFormat.Field)scalabilityCache.FetchStaticReference(id2);
                    break;
                }

                case MemberName.Value:
                    this.m_value = reader.ReadVariant();
                    break;

                case MemberName.IsValueReady:
                    this.m_isValueReady = reader.ReadBoolean();
                    break;

                case MemberName.IsVisited:
                    this.m_isVisited = reader.ReadBoolean();
                    break;

                case MemberName.ReportRuntime:
                {
                    int id = reader.ReadInt32();
                    this.m_reportRT      = (AspNetCore.ReportingServices.RdlExpressions.ReportRuntime)scalabilityCache.FetchStaticReference(id);
                    this.m_iErrorContext = this.m_reportRT;
                    break;
                }

                case MemberName.ErrorOccurred:
                    this.m_errorOccurred = reader.ReadBoolean();
                    break;

                case MemberName.ExceptionMessage:
                    this.m_exceptionMessage = reader.ReadString();
                    break;

                default:
                    Global.Tracer.Assert(false);
                    break;
                }
            }
        }
Example #7
0
        public override List <ScopeValueFieldName> GetScopeValueFieldNameCollection(AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet dataSet)
        {
            List <ScopeValueFieldName> list = new List <ScopeValueFieldName>();
            int num = 0;

            foreach (ScopeValue item in this.m_scopeID.QueryRestartPosition)
            {
                AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = this.Expressions[num];
                AspNetCore.ReportingServices.ReportIntermediateFormat.Field          field          = dataSet.Fields[expressionInfo.FieldIndex];
                string dataField = field.DataField;
                list.Add(new ScopeValueFieldName(dataField, item.Value));
                num++;
            }
            return(list);
        }
        private void PopulateServerAggregateInformationFromIndicatorFields(AspNetCore.ReportingServices.ReportIntermediateFormat.RecordRow recordRow)
        {
            int num  = 0;
            int num2 = 0;

            for (int i = 0; i < recordRow.RecordFields.Length; i++)
            {
                AspNetCore.ReportingServices.ReportIntermediateFormat.RecordField recordField = recordRow.RecordFields[i];
                AspNetCore.ReportingServices.ReportIntermediateFormat.Field       field       = base.m_dataSet.Fields[i];
                if (recordField != null && field.HasAggregateIndicatorField)
                {
                    num++;
                    AspNetCore.ReportingServices.ReportIntermediateFormat.Field field2 = base.m_dataSet.Fields[field.AggregateIndicatorFieldIndex];
                    bool flag = false;
                    bool flag2;
                    if (field2.IsCalculatedField)
                    {
                        if (field2.Value.Type == AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant)
                        {
                            flag  = field2.Value.BoolValue;
                            flag2 = false;
                        }
                        else
                        {
                            flag2 = !AspNetCore.ReportingServices.RdlExpressions.ReportRuntime.TryProcessObjectToBoolean(field2.Value.LiteralInfo.Value, out flag);
                        }
                    }
                    else
                    {
                        AspNetCore.ReportingServices.ReportIntermediateFormat.RecordField recordField2 = recordRow.RecordFields[field.AggregateIndicatorFieldIndex];
                        flag2 = (recordField2 == null || recordField2.FieldStatus != 0 || !AspNetCore.ReportingServices.RdlExpressions.ReportRuntime.TryProcessObjectToBoolean(recordField2.FieldValue, out flag));
                    }
                    if (flag2)
                    {
                        base.m_odpContext.ErrorContext.Register(ProcessingErrorCode.rsMissingOrInvalidAggregateIndicatorFieldValue, Severity.Warning, AspNetCore.ReportingServices.ReportProcessing.ObjectType.Field, field2.Name, "AggregateIndicatorField", base.m_dataSet.Name.MarkAsPrivate(), field.Name.MarkAsModelInfo());
                    }
                    else if (flag)
                    {
                        num2++;
                        recordRow.IsAggregateRow = true;
                    }
                    recordField.IsAggregationField = !flag;
                }
            }
            recordRow.AggregationFieldCount = num - num2;
        }
 private void MapExtendedProperties()
 {
     if (this.m_dataReader.ReaderFieldProperties)
     {
         int count = base.m_dataSet.Fields.Count;
         for (int i = 0; i < count; i++)
         {
             AspNetCore.ReportingServices.ReportIntermediateFormat.Field field = base.m_dataSet.Fields[i];
             if (!field.IsCalculatedField)
             {
                 try
                 {
                     int           propertyCount = this.m_dataReader.GetPropertyCount(i);
                     List <int>    list          = new List <int>();
                     List <string> list2         = new List <string>();
                     for (int j = 0; j < propertyCount; j++)
                     {
                         string text = null;
                         try
                         {
                             text = this.m_dataReader.GetPropertyName(i, j);
                             list.Add(j);
                             list2.Add(text);
                         }
                         catch (ReportProcessingException_FieldError reportProcessingException_FieldError)
                         {
                             base.m_odpContext.ErrorContext.Register(ProcessingErrorCode.rsErrorReadingFieldProperty, Severity.Warning, AspNetCore.ReportingServices.ReportProcessing.ObjectType.DataSet, base.m_dataSet.Name, "FieldExtendedProperty", field.Name.MarkAsModelInfo(), text.MarkAsModelInfo(), reportProcessingException_FieldError.Message);
                         }
                     }
                     if (list.Count > 0)
                     {
                         if (this.m_dataSetInstance.FieldInfos == null)
                         {
                             this.m_dataSetInstance.FieldInfos = new FieldInfo[count];
                         }
                         this.m_dataSetInstance.FieldInfos[i] = new FieldInfo(list, list2);
                     }
                 }
                 catch (ReportProcessingException_FieldError aException)
                 {
                     this.HandleFieldError(aException, i, field.Name);
                 }
             }
         }
     }
 }
        public FieldsContext(ObjectModelImpl reportOM, DataSetCore dataSet, bool addRowIndex, bool noRows)
        {
            List <AspNetCore.ReportingServices.ReportIntermediateFormat.Field> fields = dataSet.Fields;
            int        num        = (fields != null) ? fields.Count : 0;
            FieldsImpl fieldsImpl = new FieldsImpl(reportOM, num, addRowIndex, noRows);

            this.Initialize(reportOM, fieldsImpl, dataSet, null, null, true, false, DataFieldRow.UnInitializedStreamOffset);
            for (int i = 0; i < num; i++)
            {
                AspNetCore.ReportingServices.ReportIntermediateFormat.Field field = fields[i];
                if (dataSet.ExprHost != null)
                {
                    field.SetExprHost(dataSet.ExprHost, reportOM);
                }
                fieldsImpl.Add(field.Name, null);
            }
            if (addRowIndex)
            {
                fieldsImpl.AddRowIndexField();
            }
        }
        private void CreateProcessingDataReader(IDataReader reader, DataSourceErrorInspector errorInspector, bool readerExtensionsSupportedLocal)
        {
            List <AspNetCore.ReportingServices.ReportIntermediateFormat.Field> fields = base.m_dataSet.Fields;
            int num = 0;

            if (fields != null)
            {
                num = ((!base.m_odpContext.IsSharedDataSetExecutionOnly) ? base.m_dataSet.NonCalculatedFieldCount : base.m_dataSet.Fields.Count);
            }
            string[] array  = new string[num];
            string[] array2 = new string[num];
            for (int i = 0; i < num; i++)
            {
                AspNetCore.ReportingServices.ReportIntermediateFormat.Field field = fields[i];
                array[i]  = field.DataField;
                array2[i] = field.Name;
            }
            base.m_executionMetrics.StartTimer(DataProcessingMetrics.MetricType.DataReaderMapping);
            this.m_dataReader = new ProcessingDataReader(base.m_odpContext, this.m_dataSetInstance, base.m_dataSet.Name, reader, readerExtensionsSupportedLocal || base.m_dataSet.HasAggregateIndicatorFields, array2, array, errorInspector);
            base.m_executionMetrics.RecordTimerMeasurement(DataProcessingMetrics.MetricType.DataReaderMapping);
        }
        private void CreateAndInitializeCalculatedFieldWrapper(ObjectModelImpl reportOM, bool readerExtensionsSupported, DataSetCore dataSet, int fieldIndex, AspNetCore.ReportingServices.ReportIntermediateFormat.Field fieldDef)
        {
            CalculatedFieldWrapperImpl value = new CalculatedFieldWrapperImpl(fieldDef, reportOM.OdpContext.ReportRuntime);
            bool isAggregationField          = (byte)((!readerExtensionsSupported) ? 1 : 0) != 0;

            if (dataSet.InterpretSubtotalsAsDetails == AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet.TriState.True)
            {
                isAggregationField = true;
            }
            this.m_fields[fieldIndex] = new FieldImpl(reportOM, value, isAggregationField, fieldDef);
            if (dataSet.ExprHost != null && fieldDef.ExprHost == null)
            {
                fieldDef.SetExprHost(dataSet.ExprHost, reportOM);
            }
        }
        public void UpdateFieldValues(ObjectModelImpl reportOM, bool useDataSetFieldsCache, bool reuseFieldObjects, AspNetCore.ReportingServices.ReportIntermediateFormat.RecordRow row, DataSetInstance dataSetInstance, bool readerExtensionsSupported)
        {
            Global.Tracer.Assert(null != row, "Empty data row / no data reader");
            if (this.m_dataSetInstance != dataSetInstance)
            {
                this.m_dataSetInstance = dataSetInstance;
                this.m_dataSet         = dataSetInstance.DataSetDef.DataSetCore;
                if (this.m_dataSet.FieldsContext != null && useDataSetFieldsCache)
                {
                    this.m_fields = this.m_dataSet.FieldsContext.Fields;
                }
                else
                {
                    reuseFieldObjects = false;
                }
                this.m_dataReader              = null;
                this.m_lastRowOffset           = DataFieldRow.UnInitializedStreamOffset;
                this.m_pendingFieldValueUpdate = false;
            }
            this.m_allFieldsCleared = false;
            FieldInfo[] fieldInfos = dataSetInstance.FieldInfos;
            if (this.m_fields.ReaderExtensionsSupported && this.m_dataSet.InterpretSubtotalsAsDetails == AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet.TriState.False)
            {
                this.m_fields.IsAggregateRow        = row.IsAggregateRow;
                this.m_fields.AggregationFieldCount = row.AggregationFieldCount;
                if (!row.IsAggregateRow)
                {
                    this.m_fields.AggregationFieldCountForDetailRow = row.AggregationFieldCount;
                }
            }
            int num   = 0;
            int count = this.m_dataSet.Fields.Count;
            int num2  = row.RecordFields.Length;

            for (num = 0; num < num2; num++)
            {
                FieldImpl fieldImpl = reuseFieldObjects ? this.m_fields.GetFieldByIndex(num) : null;
                AspNetCore.ReportingServices.ReportIntermediateFormat.Field       fieldDef    = this.m_dataSet.Fields[num];
                AspNetCore.ReportingServices.ReportIntermediateFormat.RecordField recordField = row.RecordFields[num];
                if (recordField == null)
                {
                    if (!reuseFieldObjects || fieldImpl == null)
                    {
                        fieldImpl = new FieldImpl(reportOM, DataFieldStatus.IsMissing, null, fieldDef);
                    }
                    else
                    {
                        fieldImpl.UpdateValue(null, false, DataFieldStatus.IsMissing, null);
                    }
                }
                else if (recordField.FieldStatus == DataFieldStatus.None)
                {
                    if (!reuseFieldObjects || fieldImpl == null)
                    {
                        fieldImpl = new FieldImpl(reportOM, recordField.FieldValue, recordField.IsAggregationField, fieldDef);
                    }
                    else
                    {
                        fieldImpl.UpdateValue(recordField.FieldValue, recordField.IsAggregationField, DataFieldStatus.None, null);
                    }
                }
                else if (!reuseFieldObjects || fieldImpl == null)
                {
                    fieldImpl = new FieldImpl(reportOM, recordField.FieldStatus, ReportRuntime.GetErrorName(recordField.FieldStatus, null), fieldDef);
                }
                else
                {
                    fieldImpl.UpdateValue(null, false, recordField.FieldStatus, ReportRuntime.GetErrorName(recordField.FieldStatus, null));
                }
                if (recordField != null && fieldInfos != null)
                {
                    FieldInfo fieldInfo = fieldInfos[num];
                    if (fieldInfo != null && fieldInfo.PropertyCount != 0 && recordField.FieldPropertyValues != null)
                    {
                        for (int i = 0; i < fieldInfo.PropertyCount; i++)
                        {
                            fieldImpl.SetProperty(fieldInfo.PropertyNames[i], recordField.FieldPropertyValues[i]);
                        }
                    }
                }
                this.m_fields[num] = fieldImpl;
            }
            if (num < count)
            {
                if (!reuseFieldObjects && reportOM.OdpContext.ReportRuntime.ReportExprHost != null)
                {
                    this.m_dataSet.SetExprHost(reportOM.OdpContext.ReportRuntime.ReportExprHost, reportOM);
                }
                for (; num < count; num++)
                {
                    AspNetCore.ReportingServices.ReportIntermediateFormat.Field fieldDef2 = this.m_dataSet.Fields[num];
                    FieldImpl fieldImpl2 = reuseFieldObjects ? this.m_fields.GetFieldByIndex(num) : null;
                    if (reuseFieldObjects && fieldImpl2 != null)
                    {
                        if (!fieldImpl2.ResetCalculatedField())
                        {
                            this.CreateAndInitializeCalculatedFieldWrapper(reportOM, readerExtensionsSupported, this.m_dataSet, num, fieldDef2);
                        }
                    }
                    else
                    {
                        this.CreateAndInitializeCalculatedFieldWrapper(reportOM, readerExtensionsSupported, this.m_dataSet, num, fieldDef2);
                    }
                }
            }
        }
        private AspNetCore.ReportingServices.ReportIntermediateFormat.RecordRow ConstructRecordRow()
        {
            AspNetCore.ReportingServices.ReportIntermediateFormat.RecordRow recordRow = new AspNetCore.ReportingServices.ReportIntermediateFormat.RecordRow();
            bool flag  = this.m_dataReader.ReaderExtensionsSupported && !base.m_dataSet.HasAggregateIndicatorFields;
            bool flag2 = this.HasServerAggregateMetadata && (base.m_dataSet.InterpretSubtotalsAsDetails == AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet.TriState.False || (base.m_odpContext.IsSharedDataSetExecutionOnly && base.m_dataSet.InterpretSubtotalsAsDetails == AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet.TriState.Auto));

            AspNetCore.ReportingServices.ReportIntermediateFormat.RecordField[] array2 = recordRow.RecordFields = new AspNetCore.ReportingServices.ReportIntermediateFormat.RecordField[base.m_dataSet.NonCalculatedFieldCount];
            for (int i = 0; i < array2.Length; i++)
            {
                AspNetCore.ReportingServices.ReportIntermediateFormat.Field field = base.m_dataSet.Fields[i];
                if (!this.m_dataSetInstance.IsFieldMissing(i))
                {
                    AspNetCore.ReportingServices.ReportIntermediateFormat.RecordField recordField = new AspNetCore.ReportingServices.ReportIntermediateFormat.RecordField();
                    try
                    {
                        array2[i] = recordField;
                        recordField.FieldValue = this.m_dataReader.GetColumn(i);
                        if (flag2)
                        {
                            if (flag)
                            {
                                recordField.IsAggregationField = this.m_dataReader.IsAggregationField(i);
                            }
                        }
                        else
                        {
                            recordField.IsAggregationField = true;
                        }
                        recordField.FieldStatus = DataFieldStatus.None;
                    }
                    catch (ReportProcessingException_FieldError aException)
                    {
                        recordField = (array2[i] = this.HandleFieldError(aException, i, field.Name));
                        if (recordField != null && !flag2)
                        {
                            recordField.IsAggregationField = true;
                        }
                    }
                    this.ReadExtendedPropertiesForRecordField(i, field, recordField);
                }
                else
                {
                    array2[i] = null;
                }
            }
            if (flag2)
            {
                if (flag)
                {
                    recordRow.IsAggregateRow        = this.m_dataReader.IsAggregateRow;
                    recordRow.AggregationFieldCount = this.m_dataReader.AggregationFieldCount;
                }
                else
                {
                    this.PopulateServerAggregateInformationFromIndicatorFields(recordRow);
                }
            }
            else
            {
                recordRow.AggregationFieldCount = base.m_dataSet.Fields.Count;
            }
            return(recordRow);
        }
Example #15
0
 public Field(AspNetCore.ReportingServices.ReportIntermediateFormat.Field fieldDef)
 {
     this.m_fieldDef = fieldDef;
 }
 public CalculatedFieldWrapperImpl(AspNetCore.ReportingServices.ReportIntermediateFormat.Field fieldDef, AspNetCore.ReportingServices.RdlExpressions.ReportRuntime reportRT)
 {
     this.m_fieldDef      = fieldDef;
     this.m_reportRT      = reportRT;
     this.m_iErrorContext = reportRT;
 }
        private void SetupObjectModels(OnDemandMode mode, bool needDeepCopyPath, int moveNextInstanceIndex, string scopeName)
        {
            AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegionInstance dataRegionInstance = null;
            IMemberHierarchy memberHierarchy         = null;
            int                     num              = -1;
            ScopeInstance           scopeInstance    = base.m_odpContext.CurrentReportInstance;
            List <InstancePathItem> lastInstancePath = this.m_lastInstancePath;
            List <InstancePathItem> list             = null;
            int                     num2             = 0;

            AspNetCore.ReportingServices.ReportIntermediateFormat.Report reportDefinition = base.m_odpContext.ReportDefinition;
            ObjectModelImpl reportObjectModel = base.m_odpContext.ReportObjectModel;
            bool            flag  = false;
            bool            flag2 = false;
            int             num3  = 0;

            try
            {
                if (this.m_lastRIFObject.InstancePath != null)
                {
                    list = this.m_lastRIFObject.InstancePath;
                    num2 = list.Count;
                }
                if (mode != OnDemandMode.InScope)
                {
                    base.m_odpContext.EnsureCultureIsSetOnCurrentThread();
                }
                if (mode != OnDemandMode.InScope || 1 != reportDefinition.DataSetsNotOnlyUsedInParameters || !this.InScopeCompare(reportDefinition.FirstDataSet.Name, scopeName))
                {
                    int num4 = 0;
                    if (base.m_odpContext.InSubreport)
                    {
                        num4 = InstancePathItem.GetParentReportIndex(this.m_lastRIFObject.InstancePath, this.m_lastRIFObject.InstancePathItem.Type == InstancePathItemType.SubReport);
                    }
                    bool flag3           = default(bool);
                    int  sharedPathIndex = InstancePathItem.GetSharedPathIndex(num4, lastInstancePath, list, reportObjectModel.AllFieldsCleared, out flag3);
                    for (int i = this.m_specialLastGroupingValues.Count; i < num4; i++)
                    {
                        this.m_specialLastGroupingValues.Add(null);
                    }
                    for (int j = num4; j < num2; j++)
                    {
                        InstancePathItem instancePathItem = list[j];
                        bool             flag4            = false;
                        if (mode != OnDemandMode.InScope)
                        {
                            flag4 = (j <= sharedPathIndex);
                        }
                        if (!flag4 && mode == OnDemandMode.FullSetup)
                        {
                            if (this.m_specialLastGroupingValues.Count < num2)
                            {
                                this.m_specialLastGroupingValues.Add(null);
                            }
                            else
                            {
                                this.m_specialLastGroupingValues[j] = null;
                            }
                        }
                        switch (instancePathItem.Type)
                        {
                        case InstancePathItemType.SubReport:
                            if (scopeInstance.SubreportInstances != null && instancePathItem.IndexInCollection < scopeInstance.SubreportInstances.Count)
                            {
                                IReference <AspNetCore.ReportingServices.ReportIntermediateFormat.SubReportInstance> reference = scopeInstance.SubreportInstances[instancePathItem.IndexInCollection];
                                using (reference.PinValue())
                                {
                                    AspNetCore.ReportingServices.ReportIntermediateFormat.SubReportInstance subReportInstance = reference.Value();
                                    subReportInstance.SubReportDef.CurrentSubReportInstance = reference;
                                    if (mode != OnDemandMode.InScope && !subReportInstance.Initialized)
                                    {
                                        if (base.m_odpContext.IsTablixProcessingMode || base.m_odpContext.IsTopLevelSubReportProcessing)
                                        {
                                            return;
                                        }
                                        SubReportInitializer.InitializeSubReport(subReportInstance.SubReportDef);
                                        reference.PinValue();
                                    }
                                    Global.Tracer.Assert(j == num2 - 1, "SubReport not last in instance path.");
                                }
                            }
                            goto default;

                        case InstancePathItemType.DataRegion:
                            if (scopeInstance is AspNetCore.ReportingServices.ReportIntermediateFormat.ReportInstance && (scopeInstance.DataRegionInstances == null || scopeInstance.DataRegionInstances.Count <= instancePathItem.IndexInCollection || scopeInstance.DataRegionInstances[instancePathItem.IndexInCollection] == null || scopeInstance.DataRegionInstances[instancePathItem.IndexInCollection].Value() == null))
                            {
                                Global.Tracer.Assert(instancePathItem.IndexInCollection < reportDefinition.TopLevelDataRegions.Count, "(newItem.IndexInCollection < m_reportDefinition.TopLevelDataRegions.Count)");
                                AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegion dataRegion = reportDefinition.TopLevelDataRegions[instancePathItem.IndexInCollection];
                                AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet    dataSet    = dataRegion.GetDataSet(reportDefinition);
                                if (mode == OnDemandMode.InScope && this.InScopeCompare(dataSet.Name, scopeName))
                                {
                                    return;
                                }
                                this.PerformOnDemandTablixProcessing(dataSet);
                            }
                            scopeInstance      = scopeInstance.DataRegionInstances[instancePathItem.IndexInCollection].Value();
                            flag               = (this.m_inRecursiveColumnHierarchy = false);
                            flag2              = (this.m_inRecursiveRowHierarchy = false);
                            num                = -1;
                            dataRegionInstance = (scopeInstance as AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegionInstance);
                            memberHierarchy    = dataRegionInstance;
                            if (mode == OnDemandMode.InScope && this.InScopeCompare(dataRegionInstance.DataRegionDef.Name, scopeName))
                            {
                                return;
                            }
                            if (dataRegionInstance.DataSetIndexInCollection >= 0 && base.m_odpContext.CurrentDataSetIndex != dataRegionInstance.DataSetIndexInCollection && mode != OnDemandMode.InScope)
                            {
                                if (!flag4)
                                {
                                    AspNetCore.ReportingServices.ReportIntermediateFormat.DataSetInstance dataSetInstance = base.m_odpContext.CurrentReportInstance.GetDataSetInstance(dataRegionInstance.DataSetIndexInCollection, base.m_odpContext);
                                    if (dataSetInstance != null)
                                    {
                                        dataSetInstance.SetupEnvironment(base.m_odpContext, true);
                                        num3 = 0;
                                    }
                                }
                                else
                                {
                                    num3 = j + 1;
                                }
                            }
                            if (mode != OnDemandMode.InScope)
                            {
                                if (!flag4)
                                {
                                    dataRegionInstance.SetupEnvironment(base.m_odpContext);
                                    num3 = 0;
                                    if (!dataRegionInstance.NoRows)
                                    {
                                        dataRegionInstance.DataRegionDef.NoRows = false;
                                        goto default;
                                    }
                                    dataRegionInstance.DataRegionDef.NoRows = true;
                                    dataRegionInstance.DataRegionDef.ResetTopLevelDynamicMemberInstanceCount();
                                    return;
                                }
                                num3 = j + 1;
                            }
                            goto default;

                        case InstancePathItemType.ColumnMemberInstanceIndexTopMost:
                            scopeInstance = dataRegionInstance;
                            goto default;

                        case InstancePathItemType.Cell:
                        {
                            if (-1 == num)
                            {
                                num = 0;
                            }
                            IList <AspNetCore.ReportingServices.ReportIntermediateFormat.DataCellInstance> cellInstances = memberHierarchy.GetCellInstances(num);
                            if (cellInstances == null)
                            {
                                if (flag2 && flag)
                                {
                                    reportObjectModel.ResetFieldValues();
                                }
                            }
                            else if (cellInstances.Count > instancePathItem.IndexInCollection)
                            {
                                AspNetCore.ReportingServices.ReportIntermediateFormat.DataCellInstance dataCellInstance = cellInstances[instancePathItem.IndexInCollection];
                                if (dataCellInstance != null)
                                {
                                    scopeInstance = dataCellInstance;
                                    if (!flag4)
                                    {
                                        dataCellInstance.SetupEnvironment(base.m_odpContext, base.m_odpContext.CurrentDataSetIndex);
                                        num3 = 0;
                                    }
                                    else
                                    {
                                        num3 = j + 1;
                                    }
                                }
                            }
                            goto default;
                        }

                        default:
                            if (instancePathItem.IsDynamicMember)
                            {
                                IList <DataRegionMemberInstance> childMemberInstances = ((IMemberHierarchy)scopeInstance).GetChildMemberInstances(instancePathItem.Type == InstancePathItemType.RowMemberInstanceIndex, instancePathItem.IndexInCollection);
                                if (childMemberInstances == null)
                                {
                                    reportObjectModel.ResetFieldValues();
                                    return;
                                }
                                int num5 = (j != num2 - 1 || moveNextInstanceIndex < 0 || moveNextInstanceIndex >= childMemberInstances.Count) ? ((instancePathItem.InstanceIndex >= 0) ? instancePathItem.InstanceIndex : 0) : moveNextInstanceIndex;
                                if (num5 >= childMemberInstances.Count)
                                {
                                    instancePathItem.ResetContext();
                                    num5 = 0;
                                }
                                DataRegionMemberInstance dataRegionMemberInstance = childMemberInstances[num5];
                                if (mode == OnDemandMode.FullSetup)
                                {
                                    dataRegionMemberInstance.MemberDef.InstanceCount      = childMemberInstances.Count;
                                    dataRegionMemberInstance.MemberDef.CurrentMemberIndex = num5;
                                }
                                scopeInstance             = dataRegionMemberInstance;
                                this.m_lastRecursiveLevel = dataRegionMemberInstance.RecursiveLevel;
                                AspNetCore.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode memberDef = dataRegionMemberInstance.MemberDef;
                                if (mode == OnDemandMode.InScope && this.InScopeCompare(memberDef.Grouping.Name, scopeName))
                                {
                                    return;
                                }
                                if (instancePathItem.Type == InstancePathItemType.RowMemberInstanceIndex)
                                {
                                    memberHierarchy = dataRegionMemberInstance;
                                    flag2           = true;
                                }
                                else
                                {
                                    num  = dataRegionMemberInstance.MemberInstanceIndexWithinScopeLevel;
                                    flag = true;
                                }
                                if (mode == OnDemandMode.FullSetup && !flag4)
                                {
                                    dataRegionMemberInstance.SetupEnvironment(base.m_odpContext, base.m_odpContext.CurrentDataSetIndex);
                                    num3 = 0;
                                    AspNetCore.ReportingServices.ReportIntermediateFormat.Grouping grouping = memberDef.Grouping;
                                    if (grouping.Parent != null)
                                    {
                                        if (memberDef.IsColumn)
                                        {
                                            this.m_inRecursiveColumnHierarchy = true;
                                        }
                                        else
                                        {
                                            this.m_inRecursiveRowHierarchy = true;
                                        }
                                        if (memberDef.IsTablixMember)
                                        {
                                            memberDef.SetMemberInstances(childMemberInstances);
                                            memberDef.SetRecursiveParentIndex(dataRegionMemberInstance.RecursiveParentIndex);
                                            memberDef.SetInstanceHasRecursiveChildren(dataRegionMemberInstance.HasRecursiveChildren);
                                        }
                                    }
                                    else if (memberDef.IsColumn)
                                    {
                                        this.m_inRecursiveColumnHierarchy = false;
                                    }
                                    else
                                    {
                                        this.m_inRecursiveRowHierarchy = false;
                                    }
                                    grouping.RecursiveLevel = this.m_lastRecursiveLevel;
                                    grouping.SetGroupInstanceExpressionValues(dataRegionMemberInstance.GroupExprValues);
                                    if (mode == OnDemandMode.FullSetup && grouping != null && grouping.GroupExpressions != null && grouping.GroupExpressions.Count > 0)
                                    {
                                        AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = grouping.GroupExpressions[0];
                                        if (expressionInfo.Type == AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Field)
                                        {
                                            AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet dataSet2 = memberDef.DataRegionDef.GetDataSet(reportDefinition);
                                            AspNetCore.ReportingServices.ReportIntermediateFormat.Field   field    = dataSet2.Fields[expressionInfo.IntValue];
                                            if (field.DataField != null)
                                            {
                                                string dataField = field.DataField;
                                                object second    = dataRegionMemberInstance.GroupExprValues[0];
                                                PairObj <string, object> pairObj = this.m_specialLastGroupingValues[j];
                                                if (pairObj == null)
                                                {
                                                    pairObj = new PairObj <string, object>(dataField, second);
                                                    this.m_specialLastGroupingValues[j] = pairObj;
                                                }
                                                else
                                                {
                                                    pairObj.First  = dataField;
                                                    pairObj.Second = second;
                                                }
                                            }
                                        }
                                    }
                                }
                                else
                                {
                                    num3 = j + 1;
                                }
                            }
                            break;

                        case InstancePathItemType.None:
                            break;
                        }
                    }
                    if (mode == OnDemandMode.FullSetup && !flag3 && scopeInstance != null && num3 > 0)
                    {
                        while (num3 < this.m_lastInstancePath.Count)
                        {
                            if (!this.m_lastInstancePath[num3].IsScope)
                            {
                                num3++;
                                continue;
                            }
                            scopeInstance.SetupFields(base.m_odpContext, base.m_odpContext.CurrentDataSetIndex);
                            break;
                        }
                    }
                    if (mode == OnDemandMode.FullSetup && !base.m_odpContext.IsTablixProcessingMode && base.m_odpContext.CurrentReportInstance != null && dataRegionInstance == null && reportDefinition.DataSetsNotOnlyUsedInParameters == 1)
                    {
                        AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet         firstDataSet     = reportDefinition.FirstDataSet;
                        AspNetCore.ReportingServices.ReportIntermediateFormat.DataSetInstance dataSetInstance2 = base.m_odpContext.CurrentReportInstance.GetDataSetInstance(firstDataSet, base.m_odpContext);
                        if (dataSetInstance2 != null)
                        {
                            bool flag5 = true;
                            if (!base.m_odpContext.IsTablixProcessingComplete(firstDataSet.IndexInCollection))
                            {
                                this.PerformOnDemandTablixProcessing(firstDataSet);
                                flag5 = false;
                            }
                            if (base.m_odpContext.CurrentOdpDataSetInstance == dataSetInstance2)
                            {
                                flag5 = false;
                            }
                            if (flag5)
                            {
                                dataSetInstance2.SetupEnvironment(base.m_odpContext, true);
                            }
                            else if (!dataSetInstance2.NoRows)
                            {
                                dataSetInstance2.SetupFields(base.m_odpContext, dataSetInstance2);
                            }
                        }
                    }
                }
            }
            finally
            {
                if (needDeepCopyPath)
                {
                    InstancePathItem.DeepCopyPath(list, ref this.m_lastInstancePath);
                }
            }
        }
Example #18
0
 public FieldImpl(ObjectModelImpl reportOM, object value, bool isAggregationField, AspNetCore.ReportingServices.ReportIntermediateFormat.Field fieldDef)
 {
     this.m_reportOM = reportOM;
     this.m_fieldDef = fieldDef;
     this.UpdateValue(value, isAggregationField, DataFieldStatus.None, null);
 }