Пример #1
0
        public void Initialize(string prefix, int rowIndex, int cellIndex, bool isCustomProperty, InitializationContext context)
        {
            int count = this.Count;
            CustomPropertyUniqueNameValidator validator = new CustomPropertyUniqueNameValidator();

            for (int i = 0; i < count; i++)
            {
                Global.Tracer.Assert(null != this[i]);
                this[i].Initialize(DataValueList.CreatePropertyNameString(prefix, rowIndex + 1, cellIndex + 1, i + 1), isCustomProperty, validator, context);
            }
        }
Пример #2
0
        public DataValueList DeepClone(InitializationContext context)
        {
            int           count         = this.Count;
            DataValueList dataValueList = new DataValueList(count);

            for (int i = 0; i < count; i++)
            {
                dataValueList.Add(this[i].DeepClone(context));
            }
            return(dataValueList);
        }
 public bool Initialize(int level, CustomReportItemHeadingList peerHeadings, int headingIndex, DataCellsList dataRowCells, ref int currentIndex, ref int maxLevel, InitializationContext context)
 {
     base.m_level = level;
     if (level > maxLevel)
     {
         maxLevel = level;
     }
     context.ExprHostBuilder.DataGroupingStart(base.m_isColumn);
     if (this.m_static)
     {
         Global.Tracer.Assert(!base.m_subtotal);
         if (base.m_grouping != null)
         {
             context.ErrorContext.Register(ProcessingErrorCode.rsInvalidStaticDataGrouping, Severity.Error, context.ObjectType, context.ObjectName, "DataGrouping");
             base.m_grouping = null;
         }
         else
         {
             base.m_sorting = null;
             this.CommonInitialize(level, dataRowCells, ref currentIndex, ref maxLevel, context);
         }
     }
     else
     {
         if ((context.Location & LocationFlags.InDetail) != 0)
         {
             context.ErrorContext.Register(ProcessingErrorCode.rsInvalidDetailDataGrouping, Severity.Error, context.ObjectType, context.ObjectName, "DataGrouping");
             return(false);
         }
         if (base.m_grouping != null && base.m_grouping.CustomProperties != null)
         {
             if (this.m_customProperties == null)
             {
                 this.m_customProperties = new DataValueList(base.m_grouping.CustomProperties.Count);
             }
             this.m_customProperties.AddRange(base.m_grouping.CustomProperties);
             base.m_grouping.CustomProperties = null;
         }
         if (base.m_subtotal)
         {
             if (base.m_grouping != null)
             {
                 context.AggregateRewriteScopes = new Hashtable();
                 context.AggregateRewriteScopes.Add(base.m_grouping.Name, null);
             }
             Global.Tracer.Assert(null != peerHeadings[headingIndex]);
             int num = currentIndex;
             CustomReportItemHeading customReportItemHeading = CustomReportItemHeading.HeadingClone(this, dataRowCells, ref num, base.m_headingSpan, context);
             customReportItemHeading.m_innerHeadings = CustomReportItemHeading.HeadingListClone(this.m_innerHeadings, dataRowCells, ref num, base.m_headingSpan, context);
             Global.Tracer.Assert(currentIndex + base.m_headingSpan == num);
             Global.Tracer.Assert(!customReportItemHeading.m_subtotal && base.m_subtotal);
             Global.Tracer.Assert(headingIndex < peerHeadings.Count);
             peerHeadings.Insert(headingIndex + 1, customReportItemHeading);
             context.AggregateRewriteScopes = null;
             context.AggregateRewriteMap    = null;
         }
         if (base.m_grouping != null)
         {
             context.Location |= LocationFlags.InGrouping;
             context.RegisterGroupingScope(base.m_grouping.Name, base.m_grouping.SimpleGroupExpressions, base.m_grouping.Aggregates, base.m_grouping.PostSortAggregates, base.m_grouping.RecursiveAggregates, base.m_grouping);
             ObjectType objectType = context.ObjectType;
             string     objectName = context.ObjectName;
             context.ObjectType = ObjectType.Grouping;
             context.ObjectName = base.m_grouping.Name;
             this.CommonInitialize(level, dataRowCells, ref currentIndex, ref maxLevel, context);
             context.ObjectType = objectType;
             context.ObjectName = objectName;
             context.UnRegisterGroupingScope(base.m_grouping.Name);
         }
         else
         {
             context.Location |= LocationFlags.InDetail;
             this.CommonInitialize(level, dataRowCells, ref currentIndex, ref maxLevel, context);
         }
     }
     this.m_exprHostID   = context.ExprHostBuilder.DataGroupingEnd(base.m_isColumn);
     base.m_hasExprHost |= (this.m_exprHostID >= 0);
     return(base.m_subtotal);
 }
Пример #4
0
        public DataValueInstanceList EvaluateExpressions(ObjectType objectType, string objectName, string prefix, int rowIndex, int cellIndex, ReportProcessing.ProcessingContext pc)
        {
            int count = this.Count;
            DataValueInstanceList dataValueInstanceList = new DataValueInstanceList(count);
            bool flag = rowIndex < 0;
            CustomPropertyUniqueNameValidator customPropertyUniqueNameValidator = null;

            if (flag)
            {
                customPropertyUniqueNameValidator = new CustomPropertyUniqueNameValidator();
            }
            for (int i = 0; i < count; i++)
            {
                DataValue         dataValue         = this[i];
                DataValueInstance dataValueInstance = new DataValueInstance();
                bool   flag2             = true;
                string propertyNameValue = null;
                if (dataValue.Name != null)
                {
                    if (ExpressionInfo.Types.Constant != dataValue.Name.Type)
                    {
                        dataValueInstance.Name = pc.ReportRuntime.EvaluateDataValueNameExpression(dataValue, objectType, objectName, DataValueList.CreatePropertyNameString(prefix, rowIndex + 1, cellIndex + 1, i + 1) + ".Name");
                        propertyNameValue      = dataValueInstance.Name;
                    }
                    else
                    {
                        propertyNameValue = dataValue.Name.Value;
                    }
                }
                if (flag)
                {
                    flag2 = customPropertyUniqueNameValidator.Validate(Severity.Warning, objectType, objectName, propertyNameValue, pc.ErrorContext);
                }
                if (flag2)
                {
                    Global.Tracer.Assert(null != dataValue.Value);
                    if (ExpressionInfo.Types.Constant != dataValue.Value.Type)
                    {
                        dataValueInstance.Value = pc.ReportRuntime.EvaluateDataValueValueExpression(dataValue, objectType, objectName, DataValueList.CreatePropertyNameString(prefix, rowIndex + 1, cellIndex + 1, i + 1) + ".Value");
                    }
                }
                dataValueInstanceList.Add(dataValueInstance);
            }
            return(dataValueInstanceList);
        }