public static bool ValidateProcessingRestrictions(CustomReportItemHeadingList headings, bool isColumn, bool hasStatic, InitializationContext context) { bool flag = true; bool flag2 = false; bool flag3 = false; bool flag4 = false; string propertyName = isColumn ? "column" : "row"; if (headings != null) { for (int i = 0; i < headings.Count; i++) { CustomReportItemHeading customReportItemHeading = headings[i]; if (!customReportItemHeading.Static && customReportItemHeading.Grouping == null) { context.ErrorContext.Register(ProcessingErrorCode.rsInvalidGrouping, Severity.Error, context.ObjectType, context.ObjectName, propertyName); flag = false; } if (customReportItemHeading.Subtotal) { context.ErrorContext.Register(ProcessingErrorCode.rsCRISubtotalNotSupported, Severity.Error, context.ObjectType, context.ObjectName, propertyName); flag = false; } if (customReportItemHeading.Static && hasStatic) { flag3 = true; } if (customReportItemHeading.Static && customReportItemHeading.InnerHeadings != null) { flag4 = true; } if (!customReportItemHeading.Static && headings.Count > 1) { flag2 = true; } if (flag && !flag2 && !flag3 && !flag4 && customReportItemHeading.InnerHeadings != null && !CustomReportItemHeading.ValidateProcessingRestrictions(customReportItemHeading.InnerHeadings, isColumn, customReportItemHeading.Static, context)) { flag = false; } } } if (flag3) { context.ErrorContext.Register(ProcessingErrorCode.rsCRIMultiStaticColumnsOrRows, Severity.Error, context.ObjectType, context.ObjectName, propertyName); flag = false; } if (flag4) { context.ErrorContext.Register(ProcessingErrorCode.rsCRIStaticWithSubgroups, Severity.Error, context.ObjectType, context.ObjectName, propertyName); flag = false; } if (flag2) { context.ErrorContext.Register(ProcessingErrorCode.rsCRIMultiNonStaticGroups, Severity.Error, context.ObjectType, context.ObjectName, propertyName); flag = false; } return(flag); }
public void CopySubHeadingAggregates() { if (this.m_innerHeadings != null) { int count = this.m_innerHeadings.Count; for (int i = 0; i < count; i++) { CustomReportItemHeading customReportItemHeading = this.m_innerHeadings[i]; customReportItemHeading.CopySubHeadingAggregates(); Tablix.CopyAggregates(customReportItemHeading.Aggregates, base.m_aggregates); Tablix.CopyAggregates(customReportItemHeading.PostSortAggregates, base.m_postSortAggregates); Tablix.CopyAggregates(customReportItemHeading.RecursiveAggregates, base.m_aggregates); } } }
private static CustomReportItemHeading HeadingClone(CustomReportItemHeading heading, DataCellsList dataRowCells, ref int currentIndex, int headingSpan, InitializationContext context) { Global.Tracer.Assert(null != heading); CustomReportItemHeading customReportItemHeading = new CustomReportItemHeading(context.GenerateSubtotalID(), (CustomReportItem)heading.DataRegionDef); customReportItemHeading.m_isColumn = heading.m_isColumn; customReportItemHeading.m_level = heading.m_level; customReportItemHeading.m_static = true; customReportItemHeading.m_subtotal = false; customReportItemHeading.m_headingSpan = heading.m_headingSpan; if (heading.m_customProperties != null) { customReportItemHeading.m_customProperties = heading.m_customProperties.DeepClone(context); } if (heading.m_innerHeadings == null) { if (heading.m_isColumn) { int count = dataRowCells.Count; for (int i = 0; i < count; i++) { DataCellList dataCellList = dataRowCells[i]; Global.Tracer.Assert(currentIndex + headingSpan <= dataCellList.Count); dataCellList.Insert(currentIndex + headingSpan, dataCellList[currentIndex].DeepClone(context)); } } else { Global.Tracer.Assert(currentIndex + headingSpan <= dataRowCells.Count); DataCellList dataCellList2 = dataRowCells[currentIndex]; int count2 = dataCellList2.Count; DataCellList dataCellList3 = new DataCellList(count2); dataRowCells.Insert(currentIndex + headingSpan, dataCellList3); for (int j = 0; j < count2; j++) { dataCellList3.Add(dataCellList2[j].DeepClone(context)); } } currentIndex++; } return(customReportItemHeading); }
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); }
public CustomReportItemHeadingInstance(ReportProcessing.ProcessingContext pc, int headingCellIndex, CustomReportItemHeading headingDef, VariantList groupExpressionValues, int recursiveLevel) { if (headingDef.InnerHeadings != null) { this.m_subHeadingInstances = new CustomReportItemHeadingInstanceList(); } this.m_headingDef = headingDef; this.m_headingCellIndex = headingCellIndex; if (groupExpressionValues != null) { this.m_groupExpressionValues = new VariantList(groupExpressionValues.Count); for (int i = 0; i < groupExpressionValues.Count; i++) { if (((ArrayList)groupExpressionValues)[i] == null || DBNull.Value == ((ArrayList)groupExpressionValues)[i]) { this.m_groupExpressionValues.Add(null); } else { this.m_groupExpressionValues.Add(((ArrayList)groupExpressionValues)[i]); } } } if (headingDef.Grouping != null && headingDef.Grouping.GroupLabel != null) { this.m_label = pc.NavigationInfo.RegisterLabel(pc.ReportRuntime.EvaluateGroupingLabelExpression(headingDef.Grouping, headingDef.DataRegionDef.ObjectType, headingDef.DataRegionDef.Name)); } if (headingDef.CustomProperties != null) { this.m_customPropertyInstances = headingDef.CustomProperties.EvaluateExpressions(headingDef.DataRegionDef.ObjectType, headingDef.DataRegionDef.Name, "DataGrouping.", pc); } this.m_recursiveLevel = recursiveLevel; }