Exemplo n.º 1
0
 private void Initialize(ObjectModelImpl reportOM, FieldsImpl fields, DataSetCore dataSet, DataSetInstance dataSetInstance, Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.ChunkManager.DataChunkReader dataReader, bool allFieldsCleared, bool pendingFieldValueUpdate, long lastRowOffset)
 {
     m_fields                  = fields;
     m_dataSet                 = dataSet;
     m_dataSetInstance         = dataSetInstance;
     m_dataReader              = dataReader;
     m_allFieldsCleared        = allFieldsCleared;
     m_pendingFieldValueUpdate = pendingFieldValueUpdate;
     m_lastRowOffset           = lastRowOffset;
     AttachToDataSetCache(reportOM);
 }
Exemplo n.º 2
0
 internal void Clone(FieldsImpl fields)
 {
     if (fields != null)
     {
         m_collection   = fields.m_collection;
         m_nameMap      = fields.m_nameMap;
         m_count        = fields.m_count;
         m_referenced   = fields.m_referenced;
         m_noRows       = fields.m_noRows;
         m_fieldMissing = fields.m_fieldMissing;
     }
 }
Exemplo n.º 3
0
        internal FieldsContext(ObjectModelImpl reportOM, DataSetCore dataSet, bool addRowIndex, bool noRows)
        {
            List <Microsoft.ReportingServices.ReportIntermediateFormat.Field> fields = dataSet.Fields;
            int        num        = fields?.Count ?? 0;
            FieldsImpl fieldsImpl = new FieldsImpl(reportOM, num, addRowIndex, noRows);

            Initialize(reportOM, fieldsImpl, dataSet, null, null, allFieldsCleared: true, pendingFieldValueUpdate: false, DataFieldRow.UnInitializedStreamOffset);
            for (int i = 0; i < num; i++)
            {
                Microsoft.ReportingServices.ReportIntermediateFormat.Field field = fields[i];
                if (dataSet.ExprHost != null)
                {
                    field.SetExprHost(dataSet.ExprHost, reportOM);
                }
                fieldsImpl.Add(field.Name, null);
            }
            if (addRowIndex)
            {
                fieldsImpl.AddRowIndexField();
            }
        }
Exemplo n.º 4
0
        internal void UpdateFieldValues(ObjectModelImpl reportOM, bool useDataSetFieldsCache, bool reuseFieldObjects, Microsoft.ReportingServices.ReportIntermediateFormat.RecordRow row, DataSetInstance dataSetInstance, bool readerExtensionsSupported)
        {
            Global.Tracer.Assert(row != null, "Empty data row / no data reader");
            if (m_dataSetInstance != dataSetInstance)
            {
                m_dataSetInstance = dataSetInstance;
                m_dataSet         = dataSetInstance.DataSetDef.DataSetCore;
                if (m_dataSet.FieldsContext != null && useDataSetFieldsCache)
                {
                    m_fields = m_dataSet.FieldsContext.Fields;
                }
                else
                {
                    reuseFieldObjects = false;
                }
                m_dataReader              = null;
                m_lastRowOffset           = DataFieldRow.UnInitializedStreamOffset;
                m_pendingFieldValueUpdate = false;
            }
            m_allFieldsCleared = false;
            FieldInfo[] fieldInfos = dataSetInstance.FieldInfos;
            if (m_fields.ReaderExtensionsSupported && m_dataSet.InterpretSubtotalsAsDetails == Microsoft.ReportingServices.ReportIntermediateFormat.DataSet.TriState.False)
            {
                m_fields.IsAggregateRow        = row.IsAggregateRow;
                m_fields.AggregationFieldCount = row.AggregationFieldCount;
                if (!row.IsAggregateRow)
                {
                    m_fields.AggregationFieldCountForDetailRow = row.AggregationFieldCount;
                }
            }
            int num   = 0;
            int count = m_dataSet.Fields.Count;
            int num2  = row.RecordFields.Length;

            for (num = 0; num < num2; num++)
            {
                FieldImpl fieldImpl = reuseFieldObjects ? m_fields.GetFieldByIndex(num) : null;
                Microsoft.ReportingServices.ReportIntermediateFormat.Field       fieldDef    = m_dataSet.Fields[num];
                Microsoft.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, isAggregationField: 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, isAggregationField: 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]);
                        }
                    }
                }
                m_fields[num] = fieldImpl;
            }
            if (num >= count)
            {
                return;
            }
            if (!reuseFieldObjects && reportOM.OdpContext.ReportRuntime.ReportExprHost != null)
            {
                m_dataSet.SetExprHost(reportOM.OdpContext.ReportRuntime.ReportExprHost, reportOM);
            }
            for (; num < count; num++)
            {
                Microsoft.ReportingServices.ReportIntermediateFormat.Field fieldDef2 = m_dataSet.Fields[num];
                FieldImpl fieldImpl2 = reuseFieldObjects ? m_fields.GetFieldByIndex(num) : null;
                if (reuseFieldObjects && fieldImpl2 != null)
                {
                    if (!fieldImpl2.ResetCalculatedField())
                    {
                        CreateAndInitializeCalculatedFieldWrapper(reportOM, readerExtensionsSupported, m_dataSet, num, fieldDef2);
                    }
                }
                else
                {
                    CreateAndInitializeCalculatedFieldWrapper(reportOM, readerExtensionsSupported, m_dataSet, num, fieldDef2);
                }
            }
        }
Exemplo n.º 5
0
 internal void AddFieldsUsedInExpression(List <string> fieldsUsedInExpression)
 {
     FieldsImpl.AddFieldsUsedInExpression(fieldsUsedInExpression);
     AggregatesImpl.AddFieldsUsedInExpression(m_odpContext, fieldsUsedInExpression);
 }
Exemplo n.º 6
0
 internal void ResetFieldsUsedInExpression()
 {
     FieldsImpl.ResetFieldsUsedInExpression();
     AggregatesImpl.ResetFieldsUsedInExpression();
 }