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; } }
public void Add(string name, FieldImpl field) { Global.Tracer.Assert(null != this.m_collection, "(null != m_collection)"); Global.Tracer.Assert(null != this.m_nameMap, "(null != m_nameMap)"); Global.Tracer.Assert(this.m_count < this.m_collection.Length, "(m_count < m_collection.Length)"); this.m_nameMap.Add(name, this.m_count); this.m_collection[this.m_count] = field; this.m_count++; }
public void ConsumeAggregationField(int fieldIndex) { FieldImpl fieldImpl = this[fieldIndex]; if (!fieldImpl.AggregationFieldChecked && fieldImpl.IsAggregationField) { fieldImpl.AggregationFieldChecked = true; this.m_aggregationFieldCount--; } }
public void CreateNullFieldValues() { int count = this.m_fields.Count; for (int i = 0; i < count; i++) { FieldImpl fieldByIndex = this.m_fields.GetFieldByIndex(i); if (fieldByIndex != null) { fieldByIndex.UpdateValue(null, false, DataFieldStatus.None, null); } } this.ResetFieldFlags(); }
public void AddFieldsUsedInExpression(List <string> fieldsUsedInValueExpression) { if (this.m_collection != null) { for (int i = 0; i < this.m_collection.Length; i++) { FieldImpl fieldImpl = this.m_collection[i]; if (fieldImpl != null && fieldImpl.UsedInExpression && fieldImpl.FieldDef != null && fieldImpl.FieldDef.DataField != null) { fieldsUsedInValueExpression.Add(fieldImpl.FieldDef.DataField); } } } }
public void ResetFieldsUsedInExpression() { if (this.m_collection != null) { for (int i = 0; i < this.m_collection.Length; i++) { FieldImpl fieldImpl = this.m_collection[i]; if (fieldImpl != null) { fieldImpl.UsedInExpression = false; } } } }
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); } } } }