private void Initialize(ObjectModelImpl reportOM, FieldsImpl fields, DataSetCore dataSet, DataSetInstance dataSetInstance, AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ChunkManager.DataChunkReader dataReader, bool allFieldsCleared, bool pendingFieldValueUpdate, long lastRowOffset)
 {
     this.m_fields                  = fields;
     this.m_dataSet                 = dataSet;
     this.m_dataSetInstance         = dataSetInstance;
     this.m_dataReader              = dataReader;
     this.m_allFieldsCleared        = allFieldsCleared;
     this.m_pendingFieldValueUpdate = pendingFieldValueUpdate;
     this.m_lastRowOffset           = lastRowOffset;
     this.AttachToDataSetCache(reportOM);
 }
예제 #2
0
 public void Clone(FieldsImpl fields)
 {
     if (fields != null)
     {
         this.m_collection   = fields.m_collection;
         this.m_nameMap      = fields.m_nameMap;
         this.m_count        = fields.m_count;
         this.m_referenced   = fields.m_referenced;
         this.m_noRows       = fields.m_noRows;
         this.m_fieldMissing = fields.m_fieldMissing;
     }
 }
        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();
            }
        }
        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);
                    }
                }
            }
        }