internal void UpdateRecordField(Microsoft.ReportingServices.ReportIntermediateFormat.RecordField field)
 {
     m_recordField = field;
     if (m_extendedProperties != null)
     {
         for (int i = 0; i < m_extendedProperties.Length; i++)
         {
             m_extendedProperties[i]?.UpdateValue(GetFieldPropertyValue(i));
         }
     }
 }
 public override RowSkippingControlFlag DoesNotMatchRowRecordField(OnDemandProcessingContext odpContext, Microsoft.ReportingServices.ReportIntermediateFormat.RecordField[] recordFields)
 {
     for (int i = 0; i < m_expressions.Length; i++)
     {
         Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = m_expressions[i];
         object value = m_values[i].Value;
         Microsoft.ReportingServices.ReportIntermediateFormat.RecordField field = recordFields[expressionInfo.FieldIndex];
         bool isSortedAscending = m_sortDirections[i] == SortDirection.Ascending;
         RowSkippingControlFlag rowSkippingControlFlag = CompareFieldWithScopeValueAndStopOnInequality(odpContext, field, value, isSortedAscending, ObjectType.DataSet, m_idcDataSet.Name, "Relationship.QueryRestart");
         if (rowSkippingControlFlag != 0)
         {
             return(rowSkippingControlFlag);
         }
     }
     return(RowSkippingControlFlag.ExactMatch);
 }
Beispiel #3
0
        private void PopulateServerAggregateInformationFromIndicatorFields(Microsoft.ReportingServices.ReportIntermediateFormat.RecordRow recordRow)
        {
            int num  = 0;
            int num2 = 0;

            for (int i = 0; i < recordRow.RecordFields.Length; i++)
            {
                Microsoft.ReportingServices.ReportIntermediateFormat.RecordField recordField = recordRow.RecordFields[i];
                Microsoft.ReportingServices.ReportIntermediateFormat.Field       field       = m_dataSet.Fields[i];
                if (recordField == null || !field.HasAggregateIndicatorField)
                {
                    continue;
                }
                num++;
                Microsoft.ReportingServices.ReportIntermediateFormat.Field field2 = m_dataSet.Fields[field.AggregateIndicatorFieldIndex];
                bool processedValue = false;
                bool flag;
                if (field2.IsCalculatedField)
                {
                    if (field2.Value.Type == Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Constant)
                    {
                        processedValue = field2.Value.BoolValue;
                        flag           = false;
                    }
                    else
                    {
                        flag = !Microsoft.ReportingServices.RdlExpressions.ReportRuntime.TryProcessObjectToBoolean(field2.Value.LiteralInfo.Value, out processedValue);
                    }
                }
                else
                {
                    Microsoft.ReportingServices.ReportIntermediateFormat.RecordField recordField2 = recordRow.RecordFields[field.AggregateIndicatorFieldIndex];
                    flag = (recordField2 == null || recordField2.FieldStatus != 0 || !Microsoft.ReportingServices.RdlExpressions.ReportRuntime.TryProcessObjectToBoolean(recordField2.FieldValue, out processedValue));
                }
                if (flag)
                {
                    m_odpContext.ErrorContext.Register(ProcessingErrorCode.rsMissingOrInvalidAggregateIndicatorFieldValue, Severity.Warning, Microsoft.ReportingServices.ReportProcessing.ObjectType.Field, field2.Name, "AggregateIndicatorField", m_dataSet.Name.MarkAsPrivate(), field.Name.MarkAsModelInfo());
                }
                else if (processedValue)
                {
                    num2++;
                    recordRow.IsAggregateRow = true;
                }
                recordField.IsAggregationField = !processedValue;
            }
            recordRow.AggregationFieldCount = num - num2;
        }
        public override RowSkippingControlFlag DoesNotMatchRowRecordField(OnDemandProcessingContext odpContext, Microsoft.ReportingServices.ReportIntermediateFormat.RecordField[] recordFields)
        {
            int num = 0;

            foreach (ScopeValue item in m_scopeID.QueryRestartPosition)
            {
                Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = Expressions[num];
                Microsoft.ReportingServices.ReportIntermediateFormat.RecordField    field          = recordFields[expressionInfo.FieldIndex];
                RowSkippingControlFlag rowSkippingControlFlag = CompareFieldWithScopeValueAndStopOnInequality(odpContext, field, item.Value, SortDirections[num], ObjectType.DataSet, m_memberDef.DataScopeInfo.DataSet.Name, "ScopeID.QueryRestart");
                if (rowSkippingControlFlag != 0)
                {
                    return(rowSkippingControlFlag);
                }
                num++;
            }
            return(RowSkippingControlFlag.ExactMatch);
        }
Beispiel #5
0
 internal RecordRow(FieldsImpl fields, int fieldCount, FieldInfo[] fieldInfos)
 {
     m_recordFields = new RecordField[fieldCount];
     for (int i = 0; i < fieldCount; i++)
     {
         if (!fields[i].IsMissing)
         {
             FieldInfo fieldInfo = null;
             if (fieldInfos != null && i < fieldInfos.Length)
             {
                 fieldInfo = fieldInfos[i];
             }
             m_recordFields[i] = new RecordField(fields[i], fieldInfo);
         }
     }
     m_isAggregateRow        = fields.IsAggregateRow;
     m_aggregationFieldCount = fields.AggregationFieldCount;
 }
Beispiel #6
0
        private Microsoft.ReportingServices.ReportIntermediateFormat.RecordField HandleFieldError(ReportProcessingException_FieldError aException, int aFieldIndex, string aFieldName)
        {
            Microsoft.ReportingServices.ReportIntermediateFormat.RecordField recordField = null;
            bool      flag = false;
            FieldInfo orCreateFieldInfo = m_dataSetInstance.GetOrCreateFieldInfo(aFieldIndex);

            if (m_dataRowsRead == 0 && DataFieldStatus.UnSupportedDataType != aException.Status && DataFieldStatus.Overflow != aException.Status)
            {
                orCreateFieldInfo.Missing = true;
                recordField = null;
                flag        = true;
                m_odpContext.ErrorContext.Register(ProcessingErrorCode.rsMissingFieldInDataSet, Severity.Warning, Microsoft.ReportingServices.ReportProcessing.ObjectType.DataSet, m_dataSet.Name, "Field", aFieldName.MarkAsModelInfo());
            }
            if (!flag)
            {
                recordField                    = new Microsoft.ReportingServices.ReportIntermediateFormat.RecordField();
                recordField.FieldStatus        = aException.Status;
                recordField.IsAggregationField = false;
                recordField.FieldValue         = null;
            }
            if (!orCreateFieldInfo.ErrorRegistered)
            {
                orCreateFieldInfo.ErrorRegistered = true;
                if (DataFieldStatus.UnSupportedDataType == aException.Status)
                {
                    if (!m_odpContext.ProcessReportParameters)
                    {
                        m_odpContext.ErrorSavingSnapshotData = true;
                    }
                    m_odpContext.ErrorContext.Register(ProcessingErrorCode.rsDataSetFieldTypeNotSupported, Severity.Warning, Microsoft.ReportingServices.ReportProcessing.ObjectType.DataSet, m_dataSet.Name, "Field", aFieldName.MarkAsModelInfo());
                }
                else
                {
                    m_odpContext.ErrorContext.Register(ProcessingErrorCode.rsErrorReadingDataSetField, Severity.Warning, Microsoft.ReportingServices.ReportProcessing.ObjectType.DataSet, m_dataSet.Name, "Field", aFieldName.MarkAsModelInfo(), aException.Message);
                }
            }
            return(recordField);
        }
Beispiel #7
0
        private void ReadExtendedPropertiesForRecordField(int fieldIndex, Microsoft.ReportingServices.ReportIntermediateFormat.Field fieldDef, Microsoft.ReportingServices.ReportIntermediateFormat.RecordField field)
        {
            if (!m_dataReader.ReaderFieldProperties || m_dataSetInstance.GetFieldPropertyCount(fieldIndex) <= 0)
            {
                return;
            }
            FieldInfo orCreateFieldInfo = 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 = m_dataReader.GetPropertyValue(fieldIndex, propertyIndex);
                    field.FieldPropertyValues.Add(propertyValue);
                }
                catch (ReportProcessingException_FieldError reportProcessingException_FieldError)
                {
                    if (!orCreateFieldInfo.IsPropertyErrorRegistered(i))
                    {
                        m_odpContext.ErrorContext.Register(ProcessingErrorCode.rsErrorReadingFieldProperty, Severity.Warning, Microsoft.ReportingServices.ReportProcessing.ObjectType.DataSet, m_dataSet.Name, "FieldExtendedProperty", fieldDef.Name.MarkAsModelInfo(), modelInfo.MarkAsModelInfo(), reportProcessingException_FieldError.Message);
                        orCreateFieldInfo.SetPropertyErrorRegistered(i);
                    }
                    field.FieldPropertyValues.Add(null);
                }
            }
        }
Beispiel #8
0
        private Microsoft.ReportingServices.ReportIntermediateFormat.RecordRow ConstructRecordRow()
        {
            Microsoft.ReportingServices.ReportIntermediateFormat.RecordRow recordRow = new Microsoft.ReportingServices.ReportIntermediateFormat.RecordRow();
            bool flag  = m_dataReader.ReaderExtensionsSupported && !m_dataSet.HasAggregateIndicatorFields;
            bool flag2 = HasServerAggregateMetadata && (m_dataSet.InterpretSubtotalsAsDetails == Microsoft.ReportingServices.ReportIntermediateFormat.DataSet.TriState.False || (m_odpContext.IsSharedDataSetExecutionOnly && m_dataSet.InterpretSubtotalsAsDetails == Microsoft.ReportingServices.ReportIntermediateFormat.DataSet.TriState.Auto));

            Microsoft.ReportingServices.ReportIntermediateFormat.RecordField[] array2 = recordRow.RecordFields = new Microsoft.ReportingServices.ReportIntermediateFormat.RecordField[m_dataSet.NonCalculatedFieldCount];
            for (int i = 0; i < array2.Length; i++)
            {
                Microsoft.ReportingServices.ReportIntermediateFormat.Field field = m_dataSet.Fields[i];
                if (!m_dataSetInstance.IsFieldMissing(i))
                {
                    Microsoft.ReportingServices.ReportIntermediateFormat.RecordField recordField = new Microsoft.ReportingServices.ReportIntermediateFormat.RecordField();
                    try
                    {
                        array2[i] = recordField;
                        recordField.FieldValue = m_dataReader.GetColumn(i);
                        if (flag2)
                        {
                            if (flag)
                            {
                                recordField.IsAggregationField = m_dataReader.IsAggregationField(i);
                            }
                        }
                        else
                        {
                            recordField.IsAggregationField = true;
                        }
                        recordField.FieldStatus = DataFieldStatus.None;
                    }
                    catch (ReportProcessingException_FieldError aException)
                    {
                        recordField = (array2[i] = HandleFieldError(aException, i, field.Name));
                        if (recordField != null && !flag2)
                        {
                            recordField.IsAggregationField = true;
                        }
                    }
                    ReadExtendedPropertiesForRecordField(i, field, recordField);
                }
                else
                {
                    array2[i] = null;
                }
            }
            if (flag2)
            {
                if (flag)
                {
                    recordRow.IsAggregateRow        = m_dataReader.IsAggregateRow;
                    recordRow.AggregationFieldCount = m_dataReader.AggregationFieldCount;
                }
                else
                {
                    PopulateServerAggregateInformationFromIndicatorFields(recordRow);
                }
            }
            else
            {
                recordRow.AggregationFieldCount = m_dataSet.Fields.Count;
            }
            return(recordRow);
        }
        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);
                }
            }
        }
Beispiel #10
0
        public RowSkippingControlFlag CompareFieldWithScopeValueAndStopOnInequality(OnDemandProcessingContext odpContext, Microsoft.ReportingServices.ReportIntermediateFormat.RecordField field, object scopeValue, bool isSortedAscending, ObjectType objectType, string objectName, string propertyName)
        {
            if (field == null)
            {
                throw new ReportProcessingException(ErrorCode.rsMissingFieldInStartAt);
            }
            int num = odpContext.CompareAndStopOnError(field.FieldValue, scopeValue, objectType, objectName, propertyName, extendedTypeComparisons: false);

            if (num < 0)
            {
                if (!isSortedAscending)
                {
                    return(RowSkippingControlFlag.Stop);
                }
                return(RowSkippingControlFlag.Skip);
            }
            if (num > 0)
            {
                if (!isSortedAscending)
                {
                    return(RowSkippingControlFlag.Skip);
                }
                return(RowSkippingControlFlag.Stop);
            }
            return(RowSkippingControlFlag.ExactMatch);
        }
 internal ExtendedPropertyCollection(Microsoft.ReportingServices.ReportIntermediateFormat.RecordField field, List <string> extendedPropertyNames)
 {
     m_recordField           = field;
     m_extendedPropertyNames = extendedPropertyNames;
 }