internal static List <Declaration> GetChunkDeclarations() { if (m_ChunkDeclarations == null) { return(new List <Declaration>(21) { ScopeInstance.GetDeclaration(), ReportInstance.GetDeclaration(), DataSetInstance.GetDeclaration(), DataRegionInstance.GetDeclaration(), DataRegionMemberInstance.GetDeclaration(), DataCellInstance.GetDeclaration(), DataAggregateObjResult.GetDeclaration(), SubReportInstance.GetDeclaration(), GroupTreePartition.GetDeclaration(), ReportSnapshot.GetDeclaration(), ParametersImplWrapper.GetDeclaration(), ParameterImplWrapper.GetDeclaration(), SubReportInfo.GetDeclaration(), ParameterInfo.GetNewDeclaration(), ParameterInfoCollection.GetDeclaration(), ParameterBase.GetNewDeclaration(), ValidValue.GetNewDeclaration(), FieldInfo.GetDeclaration(), TreePartitionManager.GetDeclaration(), LookupObjResult.GetDeclaration(), DataCellInstanceList.GetDeclaration() }); } return(m_ChunkDeclarations); }
public static List <Declaration> GetChunkDeclarations() { if (OnDemandProcessingManager.m_ChunkDeclarations == null) { List <Declaration> list = new List <Declaration>(21); list.Add(ScopeInstance.GetDeclaration()); list.Add(ReportInstance.GetDeclaration()); list.Add(DataSetInstance.GetDeclaration()); list.Add(DataRegionInstance.GetDeclaration()); list.Add(DataRegionMemberInstance.GetDeclaration()); list.Add(DataCellInstance.GetDeclaration()); list.Add(DataAggregateObjResult.GetDeclaration()); list.Add(SubReportInstance.GetDeclaration()); list.Add(GroupTreePartition.GetDeclaration()); list.Add(ReportSnapshot.GetDeclaration()); list.Add(ParametersImplWrapper.GetDeclaration()); list.Add(ParameterImplWrapper.GetDeclaration()); list.Add(SubReportInfo.GetDeclaration()); list.Add(ParameterInfo.GetNewDeclaration()); list.Add(ParameterInfoCollection.GetDeclaration()); list.Add(ParameterBase.GetNewDeclaration()); list.Add(ValidValue.GetNewDeclaration()); list.Add(FieldInfo.GetDeclaration()); list.Add(TreePartitionManager.GetDeclaration()); list.Add(LookupObjResult.GetDeclaration()); list.Add(DataCellInstanceList.GetDeclaration()); return(list); } return(OnDemandProcessingManager.m_ChunkDeclarations); }
public void CreateAllDataRegionInstances(ScopeInstance parentInstance, OnDemandProcessingContext odpContext, IReference <IScope> owner) { for (int i = 0; i < this.m_dataRegionObjs.Count; i++) { RuntimeRICollection.CreateDataRegionInstance(parentInstance, odpContext, this.m_dataRegionObjs[i]); } this.m_dataRegionObjs = null; }
internal void CreateAllDataRegionInstances(ScopeInstance parentInstance, OnDemandProcessingContext odpContext, IReference <IScope> owner) { for (int i = 0; i < m_dataRegionObjs.Count; i++) { CreateDataRegionInstance(parentInstance, odpContext, m_dataRegionObjs[i]); } m_dataRegionObjs = null; }
public void CreateInstances(ScopeInstance parentInstance, OnDemandProcessingContext odpContext, IReference <IScope> owner, List <AspNetCore.ReportingServices.ReportIntermediateFormat.ReportItem> reportItems) { if (reportItems != null) { for (int i = 0; i < reportItems.Count; i++) { this.CreateInstance(parentInstance, reportItems[i], odpContext, owner); } } }
internal void CreateInstances(ScopeInstance parentInstance, IReference <RuntimeMemberObj>[] innerMembers, IReference <RuntimeDataTablixGroupLeafObj> innerGroupLeafRef) { CreateInstancesTraversalContext traversalContext = new CreateInstancesTraversalContext(parentInstance, innerMembers, innerGroupLeafRef); m_hierarchyDef.ResetInstancePathCascade(); TraverseGroupOrSortTree(ProcessingStages.CreateGroupTree, traversalContext); if (m_detailDataRows != null) { m_detailDataRows.Dispose(); } m_detailDataRows = null; m_detailUserSortTargetInfo = null; }
private static void CreateDataRegionInstance(ScopeInstance parentInstance, OnDemandProcessingContext odpContext, RuntimeDataRegionObjReference dataRegionObjRef) { if (!(dataRegionObjRef == null)) { using (dataRegionObjRef.PinValue()) { RuntimeDataTablixObj obj = (RuntimeDataTablixObj)dataRegionObjRef.Value(); Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef = obj.DataRegionDef; obj.SetupEnvironment(); DataRegionInstance dataRegionInstance = DataRegionInstance.CreateInstance(parentInstance, odpContext.OdpMetadata, dataRegionDef, odpContext.CurrentDataSetIndex).Value(); obj.CreateInstances(dataRegionInstance); dataRegionInstance.InstanceComplete(); dataRegionDef.RuntimeDataRegionObj = null; } } }
private static void CreateDataRegionInstance(ScopeInstance parentInstance, OnDemandProcessingContext odpContext, RuntimeDataRegionObjReference dataRegionObjRef) { if (!((BaseReference)dataRegionObjRef == (object)null)) { using (dataRegionObjRef.PinValue()) { RuntimeDataTablixObj runtimeDataTablixObj = (RuntimeDataTablixObj)dataRegionObjRef.Value(); AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef = runtimeDataTablixObj.DataRegionDef; runtimeDataTablixObj.SetupEnvironment(); IReference <DataRegionInstance> reference = DataRegionInstance.CreateInstance(parentInstance, odpContext.OdpMetadata, dataRegionDef, odpContext.CurrentDataSetIndex); DataRegionInstance dataRegionInstance = reference.Value(); runtimeDataTablixObj.CreateInstances(dataRegionInstance); dataRegionInstance.InstanceComplete(); dataRegionDef.RuntimeDataRegionObj = null; } } }
private void CreateInstance(ScopeInstance parentInstance, AspNetCore.ReportingServices.ReportIntermediateFormat.ReportItem reportItem, OnDemandProcessingContext odpContext, IReference <IScope> owner) { if (reportItem != null) { if (reportItem.IsDataRegion) { AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegion dataRegion = (AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegion)reportItem; RuntimeDataRegionObjReference dataRegionObjRef = this.m_dataRegionObjs[dataRegion.IndexInCollection]; RuntimeRICollection.CreateDataRegionInstance(parentInstance, odpContext, dataRegionObjRef); } else { switch (reportItem.ObjectType) { case AspNetCore.ReportingServices.ReportProcessing.ObjectType.Subreport: this.CreateSubReportInstance((AspNetCore.ReportingServices.ReportIntermediateFormat.SubReport)reportItem, parentInstance, odpContext, owner); break; case AspNetCore.ReportingServices.ReportProcessing.ObjectType.Rectangle: { AspNetCore.ReportingServices.ReportIntermediateFormat.Rectangle rectangle = (AspNetCore.ReportingServices.ReportIntermediateFormat.Rectangle)reportItem; this.CreateInstances(parentInstance, odpContext, owner, rectangle.ReportItems.ComputedReportItems); break; } case AspNetCore.ReportingServices.ReportProcessing.ObjectType.Map: { Map map = (Map)reportItem; List <MapDataRegion> mapDataRegions = map.MapDataRegions; for (int i = 0; i < mapDataRegions.Count; i++) { this.CreateInstance(parentInstance, mapDataRegions[i], odpContext, owner); } break; } } } } }
private void CreateInstance(ScopeInstance parentInstance, Microsoft.ReportingServices.ReportIntermediateFormat.ReportItem reportItem, OnDemandProcessingContext odpContext, IReference <IScope> owner) { if (reportItem == null) { return; } if (reportItem.IsDataRegion) { Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegion = (Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion)reportItem; RuntimeDataRegionObjReference dataRegionObjRef = m_dataRegionObjs[dataRegion.IndexInCollection]; CreateDataRegionInstance(parentInstance, odpContext, dataRegionObjRef); return; } switch (reportItem.ObjectType) { case Microsoft.ReportingServices.ReportProcessing.ObjectType.Subreport: CreateSubReportInstance((Microsoft.ReportingServices.ReportIntermediateFormat.SubReport)reportItem, parentInstance, odpContext, owner); break; case Microsoft.ReportingServices.ReportProcessing.ObjectType.Rectangle: { Microsoft.ReportingServices.ReportIntermediateFormat.Rectangle rectangle = (Microsoft.ReportingServices.ReportIntermediateFormat.Rectangle)reportItem; CreateInstances(parentInstance, odpContext, owner, rectangle.ReportItems.ComputedReportItems); break; } case Microsoft.ReportingServices.ReportProcessing.ObjectType.Map: { List <MapDataRegion> mapDataRegions = ((Map)reportItem).MapDataRegions; for (int i = 0; i < mapDataRegions.Count; i++) { CreateInstance(parentInstance, mapDataRegions[i], odpContext, owner); } break; } } }
private static List <Declaration> BuildDeclarations() { List <Declaration> list = new List <Declaration>(83); list.Add(Aggregate.GetDeclaration()); list.Add(AggregateRow.GetDeclaration()); list.Add(Avg.GetDeclaration()); list.Add(BTree.GetDeclaration()); list.Add(BTreeNode.GetDeclaration()); list.Add(BTreeNodeTuple.GetDeclaration()); list.Add(BTreeNodeTupleList.GetDeclaration()); list.Add(BTreeNodeHierarchyObj.GetDeclaration()); list.Add(CalculatedFieldWrapperImpl.GetDeclaration()); list.Add(ChildLeafInfo.GetDeclaration()); list.Add(Count.GetDeclaration()); list.Add(CountDistinct.GetDeclaration()); list.Add(CountRows.GetDeclaration()); list.Add(DataAggregateObj.GetDeclaration()); list.Add(DataAggregateObjResult.GetDeclaration()); list.Add(DataRegionMemberInstance.GetDeclaration()); list.Add(DataFieldRow.GetDeclaration()); list.Add(FieldImpl.GetDeclaration()); list.Add(First.GetDeclaration()); list.Add(Last.GetDeclaration()); list.Add(Max.GetDeclaration()); list.Add(Min.GetDeclaration()); list.Add(Previous.GetDeclaration()); list.Add(RuntimeCell.GetDeclaration()); list.Add(RuntimeCells.GetDeclaration()); list.Add(RuntimeCellWithContents.GetDeclaration()); list.Add(RuntimeChartCriCell.GetDeclaration()); list.Add(RuntimeChartCriGroupLeafObj.GetDeclaration()); list.Add(RuntimeChartCriObj.GetDeclaration()); list.Add(RuntimeChartObj.GetDeclaration()); list.Add(RuntimeCriObj.GetDeclaration()); list.Add(RuntimeDataRegionObj.GetDeclaration()); list.Add(RuntimeDataTablixObj.GetDeclaration()); list.Add(RuntimeDataTablixGroupLeafObj.GetDeclaration()); list.Add(RuntimeDataTablixGroupRootObj.GetDeclaration()); list.Add(RuntimeDataTablixMemberObj.GetDeclaration()); list.Add(RuntimeDataTablixWithScopedItemsObj.GetDeclaration()); list.Add(RuntimeDataTablixWithScopedItemsGroupLeafObj.GetDeclaration()); list.Add(RuntimeDetailObj.GetDeclaration()); list.Add(RuntimeExpressionInfo.GetDeclaration()); list.Add(RuntimeGroupLeafObj.GetDeclaration()); list.Add(RuntimeGroupObj.GetDeclaration()); list.Add(RuntimeGroupRootObj.GetDeclaration()); list.Add(RuntimeGroupingObj.GetDeclaration()); list.Add(RuntimeHierarchyObj.GetDeclaration()); list.Add(RuntimeMemberObj.GetDeclaration()); list.Add(RuntimeRDLDataRegionObj.GetDeclaration()); list.Add(RuntimeRICollection.GetDeclaration()); list.Add(RuntimeSortDataHolder.GetDeclaration()); list.Add(RuntimeSortFilterEventInfo.GetDeclaration()); list.Add(RuntimeSortFilterEventInfo.SortExpressionScopeInstanceHolder.GetDeclaration()); list.Add(RuntimeSortFilterEventInfo.SortFilterExpressionScopeObj.GetDeclaration()); list.Add(RuntimeSortFilterEventInfo.SortScopeValuesHolder.GetDeclaration()); list.Add(RuntimeSortHierarchyObj.GetDeclaration()); list.Add(RuntimeSortHierarchyObj.SortHierarchyStructure.GetDeclaration()); list.Add(RuntimeDataRowSortHierarchyObj.GetDeclaration()); list.Add(RuntimeTablixCell.GetDeclaration()); list.Add(RuntimeTablixGroupLeafObj.GetDeclaration()); list.Add(RuntimeTablixObj.GetDeclaration()); list.Add(RuntimeUserSortTargetInfo.GetDeclaration()); list.Add(ScopeInstance.GetDeclaration()); list.Add(ScopeLookupTable.GetDeclaration()); list.Add(StDev.GetDeclaration()); list.Add(StDevP.GetDeclaration()); list.Add(Sum.GetDeclaration()); list.Add(Var.GetDeclaration()); list.Add(VarBase.GetDeclaration()); list.Add(VarP.GetDeclaration()); list.Add(Filters.FilterKey.GetDeclaration()); list.Add(RuntimeGaugePanelObj.GetDeclaration()); list.Add(LookupMatches.GetDeclaration()); list.Add(LookupMatchesWithRows.GetDeclaration()); list.Add(LookupTable.GetDeclaration()); list.Add(RuntimeMapDataRegionObj.GetDeclaration()); list.Add(DataScopeInfo.GetDeclaration()); list.Add(BucketedDataAggregateObjs.GetDeclaration()); list.Add(DataAggregateObjBucket.GetDeclaration()); list.Add(RuntimeGroupingObjHash.GetDeclaration()); list.Add(RuntimeGroupingObjTree.GetDeclaration()); list.Add(RuntimeGroupingObjDetail.GetDeclaration()); list.Add(RuntimeGroupingObjDetailUserSort.GetDeclaration()); list.Add(RuntimeGroupingObjLinkedList.GetDeclaration()); list.Add(RuntimeGroupingObjNaturalGroup.GetDeclaration()); return(list); }
internal CreateInstancesTraversalContext(ScopeInstance parentInstance, IReference <RuntimeMemberObj>[] innerMembers, IReference <RuntimeDataTablixGroupLeafObj> innerGroupLeafRef) { m_parentInstance = parentInstance; m_innerMembers = innerMembers; m_innerGroupLeafRef = innerGroupLeafRef; }
internal abstract void CreateInstances(IReference <RuntimeDataRegionObj> outerGroupRef, OnDemandProcessingContext odpContext, DataRegionInstance dataRegionInstance, bool outerGroupings, IReference <RuntimeDataTablixGroupRootObj> currOuterGroupRoot, ScopeInstance parentInstance, IReference <RuntimeMemberObj>[] innerMembers, IReference <RuntimeDataTablixGroupLeafObj> innerGroupLeafRef);
internal override void CreateInstances(IReference <RuntimeDataRegionObj> containingScopeRef, OnDemandProcessingContext odpContext, DataRegionInstance dataRegionInstance, bool isOuterGrouping, IReference <RuntimeDataTablixGroupRootObj> currOuterGroupRoot, ScopeInstance parentInstance, IReference <RuntimeMemberObj>[] innerMembers, IReference <RuntimeDataTablixGroupLeafObj> innerGroupLeaf) { Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef = dataRegionInstance.DataRegionDef; if (isOuterGrouping && m_hasStaticMembers) { dataRegionDef.NewOuterCells(); } if (null != m_groupRoot) { dataRegionDef.CurrentOuterGroupRoot = currOuterGroupRoot; using (m_groupRoot.PinValue()) { m_groupRoot.Value().CreateInstances(parentInstance, innerMembers, innerGroupLeaf); } if (m_staticLeafCellIndexes == null) { return; } if (isOuterGrouping && m_hasStaticMembers) { dataRegionDef.NewOuterCells(); } IReference <RuntimeDataTablixGroupRootObj> reference = null; if (m_owner is IReference <RuntimeDataTablixObj> ) { using (m_owner.PinValue()) { ((RuntimeDataTablixObj)m_owner.Value()).SetupEnvironment(); } if (isOuterGrouping && m_hasStaticMembers) { reference = dataRegionDef.CurrentOuterGroupRoot; dataRegionDef.CurrentOuterGroupRoot = null; currOuterGroupRoot = null; } } else { using (containingScopeRef.PinValue()) { containingScopeRef.Value().SetupEnvironment(); } } CreateCells(containingScopeRef, odpContext, dataRegionInstance, isOuterGrouping, currOuterGroupRoot, parentInstance, innerMembers, innerGroupLeaf); if (reference != null) { dataRegionDef.CurrentOuterGroupRoot = reference; } } else { CreateCells(containingScopeRef, odpContext, dataRegionInstance, isOuterGrouping, currOuterGroupRoot, parentInstance, innerMembers, innerGroupLeaf); } }
private void CreateCells(IReference <RuntimeDataRegionObj> containingScopeRef, OnDemandProcessingContext odpContext, DataRegionInstance dataRegionInstance, bool isOuterGroup, IReference <RuntimeDataTablixGroupRootObj> currOuterGroupRoot, ScopeInstance parentInstance, IReference <RuntimeMemberObj>[] innerMembers, IReference <RuntimeDataTablixGroupLeafObj> innerGroupLeafRef) { using (containingScopeRef.PinValue()) { RuntimeDataRegionObj runtimeDataRegionObj = containingScopeRef.Value(); if (runtimeDataRegionObj is RuntimeDataTablixGroupLeafObj) { ((RuntimeDataTablixGroupLeafObj)runtimeDataRegionObj).CreateStaticCells(dataRegionInstance, parentInstance, currOuterGroupRoot, isOuterGroup, m_staticLeafCellIndexes, innerMembers, innerGroupLeafRef); } else { ((RuntimeDataTablixObj)runtimeDataRegionObj).CreateOutermostStaticCells(dataRegionInstance, isOuterGroup, innerMembers, innerGroupLeafRef); } } }
private void CreateSubReportInstance(AspNetCore.ReportingServices.ReportIntermediateFormat.SubReport subReport, ScopeInstance parentInstance, OnDemandProcessingContext odpContext, IReference <IScope> owner) { if (!subReport.ExceededMaxLevel) { IReference <AspNetCore.ReportingServices.ReportIntermediateFormat.SubReportInstance> reference2 = subReport.CurrentSubReportInstance = AspNetCore.ReportingServices.ReportIntermediateFormat.SubReportInstance.CreateInstance(parentInstance, subReport, odpContext.OdpMetadata); subReport.OdpContext.UserSortFilterContext.CurrentContainingScope = owner; odpContext.LastTablixProcessingReportScope = parentInstance.RIFReportScope; if (SubReportInitializer.InitializeSubReport(subReport)) { IReference <AspNetCore.ReportingServices.ReportIntermediateFormat.ReportInstance> reportInstance = reference2.Value().ReportInstance; Merge.PreProcessTablixes(subReport.Report, subReport.OdpContext, !odpContext.ReprocessSnapshot); if (subReport.Report.HasSubReports) { SubReportInitializer.InitializeSubReports(subReport.Report, reportInstance.Value(), subReport.OdpContext, false, true); } } if (reference2 != null) { reference2.Value().InstanceComplete(); } odpContext.EnsureCultureIsSetOnCurrentThread(); } }
private void SetupObjectModels(OnDemandMode mode, bool needDeepCopyPath, int moveNextInstanceIndex, string scopeName) { AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegionInstance dataRegionInstance = null; IMemberHierarchy memberHierarchy = null; int num = -1; ScopeInstance scopeInstance = base.m_odpContext.CurrentReportInstance; List <InstancePathItem> lastInstancePath = this.m_lastInstancePath; List <InstancePathItem> list = null; int num2 = 0; AspNetCore.ReportingServices.ReportIntermediateFormat.Report reportDefinition = base.m_odpContext.ReportDefinition; ObjectModelImpl reportObjectModel = base.m_odpContext.ReportObjectModel; bool flag = false; bool flag2 = false; int num3 = 0; try { if (this.m_lastRIFObject.InstancePath != null) { list = this.m_lastRIFObject.InstancePath; num2 = list.Count; } if (mode != OnDemandMode.InScope) { base.m_odpContext.EnsureCultureIsSetOnCurrentThread(); } if (mode != OnDemandMode.InScope || 1 != reportDefinition.DataSetsNotOnlyUsedInParameters || !this.InScopeCompare(reportDefinition.FirstDataSet.Name, scopeName)) { int num4 = 0; if (base.m_odpContext.InSubreport) { num4 = InstancePathItem.GetParentReportIndex(this.m_lastRIFObject.InstancePath, this.m_lastRIFObject.InstancePathItem.Type == InstancePathItemType.SubReport); } bool flag3 = default(bool); int sharedPathIndex = InstancePathItem.GetSharedPathIndex(num4, lastInstancePath, list, reportObjectModel.AllFieldsCleared, out flag3); for (int i = this.m_specialLastGroupingValues.Count; i < num4; i++) { this.m_specialLastGroupingValues.Add(null); } for (int j = num4; j < num2; j++) { InstancePathItem instancePathItem = list[j]; bool flag4 = false; if (mode != OnDemandMode.InScope) { flag4 = (j <= sharedPathIndex); } if (!flag4 && mode == OnDemandMode.FullSetup) { if (this.m_specialLastGroupingValues.Count < num2) { this.m_specialLastGroupingValues.Add(null); } else { this.m_specialLastGroupingValues[j] = null; } } switch (instancePathItem.Type) { case InstancePathItemType.SubReport: if (scopeInstance.SubreportInstances != null && instancePathItem.IndexInCollection < scopeInstance.SubreportInstances.Count) { IReference <AspNetCore.ReportingServices.ReportIntermediateFormat.SubReportInstance> reference = scopeInstance.SubreportInstances[instancePathItem.IndexInCollection]; using (reference.PinValue()) { AspNetCore.ReportingServices.ReportIntermediateFormat.SubReportInstance subReportInstance = reference.Value(); subReportInstance.SubReportDef.CurrentSubReportInstance = reference; if (mode != OnDemandMode.InScope && !subReportInstance.Initialized) { if (base.m_odpContext.IsTablixProcessingMode || base.m_odpContext.IsTopLevelSubReportProcessing) { return; } SubReportInitializer.InitializeSubReport(subReportInstance.SubReportDef); reference.PinValue(); } Global.Tracer.Assert(j == num2 - 1, "SubReport not last in instance path."); } } goto default; case InstancePathItemType.DataRegion: if (scopeInstance is AspNetCore.ReportingServices.ReportIntermediateFormat.ReportInstance && (scopeInstance.DataRegionInstances == null || scopeInstance.DataRegionInstances.Count <= instancePathItem.IndexInCollection || scopeInstance.DataRegionInstances[instancePathItem.IndexInCollection] == null || scopeInstance.DataRegionInstances[instancePathItem.IndexInCollection].Value() == null)) { Global.Tracer.Assert(instancePathItem.IndexInCollection < reportDefinition.TopLevelDataRegions.Count, "(newItem.IndexInCollection < m_reportDefinition.TopLevelDataRegions.Count)"); AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegion dataRegion = reportDefinition.TopLevelDataRegions[instancePathItem.IndexInCollection]; AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet dataSet = dataRegion.GetDataSet(reportDefinition); if (mode == OnDemandMode.InScope && this.InScopeCompare(dataSet.Name, scopeName)) { return; } this.PerformOnDemandTablixProcessing(dataSet); } scopeInstance = scopeInstance.DataRegionInstances[instancePathItem.IndexInCollection].Value(); flag = (this.m_inRecursiveColumnHierarchy = false); flag2 = (this.m_inRecursiveRowHierarchy = false); num = -1; dataRegionInstance = (scopeInstance as AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegionInstance); memberHierarchy = dataRegionInstance; if (mode == OnDemandMode.InScope && this.InScopeCompare(dataRegionInstance.DataRegionDef.Name, scopeName)) { return; } if (dataRegionInstance.DataSetIndexInCollection >= 0 && base.m_odpContext.CurrentDataSetIndex != dataRegionInstance.DataSetIndexInCollection && mode != OnDemandMode.InScope) { if (!flag4) { AspNetCore.ReportingServices.ReportIntermediateFormat.DataSetInstance dataSetInstance = base.m_odpContext.CurrentReportInstance.GetDataSetInstance(dataRegionInstance.DataSetIndexInCollection, base.m_odpContext); if (dataSetInstance != null) { dataSetInstance.SetupEnvironment(base.m_odpContext, true); num3 = 0; } } else { num3 = j + 1; } } if (mode != OnDemandMode.InScope) { if (!flag4) { dataRegionInstance.SetupEnvironment(base.m_odpContext); num3 = 0; if (!dataRegionInstance.NoRows) { dataRegionInstance.DataRegionDef.NoRows = false; goto default; } dataRegionInstance.DataRegionDef.NoRows = true; dataRegionInstance.DataRegionDef.ResetTopLevelDynamicMemberInstanceCount(); return; } num3 = j + 1; } goto default; case InstancePathItemType.ColumnMemberInstanceIndexTopMost: scopeInstance = dataRegionInstance; goto default; case InstancePathItemType.Cell: { if (-1 == num) { num = 0; } IList <AspNetCore.ReportingServices.ReportIntermediateFormat.DataCellInstance> cellInstances = memberHierarchy.GetCellInstances(num); if (cellInstances == null) { if (flag2 && flag) { reportObjectModel.ResetFieldValues(); } } else if (cellInstances.Count > instancePathItem.IndexInCollection) { AspNetCore.ReportingServices.ReportIntermediateFormat.DataCellInstance dataCellInstance = cellInstances[instancePathItem.IndexInCollection]; if (dataCellInstance != null) { scopeInstance = dataCellInstance; if (!flag4) { dataCellInstance.SetupEnvironment(base.m_odpContext, base.m_odpContext.CurrentDataSetIndex); num3 = 0; } else { num3 = j + 1; } } } goto default; } default: if (instancePathItem.IsDynamicMember) { IList <DataRegionMemberInstance> childMemberInstances = ((IMemberHierarchy)scopeInstance).GetChildMemberInstances(instancePathItem.Type == InstancePathItemType.RowMemberInstanceIndex, instancePathItem.IndexInCollection); if (childMemberInstances == null) { reportObjectModel.ResetFieldValues(); return; } int num5 = (j != num2 - 1 || moveNextInstanceIndex < 0 || moveNextInstanceIndex >= childMemberInstances.Count) ? ((instancePathItem.InstanceIndex >= 0) ? instancePathItem.InstanceIndex : 0) : moveNextInstanceIndex; if (num5 >= childMemberInstances.Count) { instancePathItem.ResetContext(); num5 = 0; } DataRegionMemberInstance dataRegionMemberInstance = childMemberInstances[num5]; if (mode == OnDemandMode.FullSetup) { dataRegionMemberInstance.MemberDef.InstanceCount = childMemberInstances.Count; dataRegionMemberInstance.MemberDef.CurrentMemberIndex = num5; } scopeInstance = dataRegionMemberInstance; this.m_lastRecursiveLevel = dataRegionMemberInstance.RecursiveLevel; AspNetCore.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode memberDef = dataRegionMemberInstance.MemberDef; if (mode == OnDemandMode.InScope && this.InScopeCompare(memberDef.Grouping.Name, scopeName)) { return; } if (instancePathItem.Type == InstancePathItemType.RowMemberInstanceIndex) { memberHierarchy = dataRegionMemberInstance; flag2 = true; } else { num = dataRegionMemberInstance.MemberInstanceIndexWithinScopeLevel; flag = true; } if (mode == OnDemandMode.FullSetup && !flag4) { dataRegionMemberInstance.SetupEnvironment(base.m_odpContext, base.m_odpContext.CurrentDataSetIndex); num3 = 0; AspNetCore.ReportingServices.ReportIntermediateFormat.Grouping grouping = memberDef.Grouping; if (grouping.Parent != null) { if (memberDef.IsColumn) { this.m_inRecursiveColumnHierarchy = true; } else { this.m_inRecursiveRowHierarchy = true; } if (memberDef.IsTablixMember) { memberDef.SetMemberInstances(childMemberInstances); memberDef.SetRecursiveParentIndex(dataRegionMemberInstance.RecursiveParentIndex); memberDef.SetInstanceHasRecursiveChildren(dataRegionMemberInstance.HasRecursiveChildren); } } else if (memberDef.IsColumn) { this.m_inRecursiveColumnHierarchy = false; } else { this.m_inRecursiveRowHierarchy = false; } grouping.RecursiveLevel = this.m_lastRecursiveLevel; grouping.SetGroupInstanceExpressionValues(dataRegionMemberInstance.GroupExprValues); if (mode == OnDemandMode.FullSetup && grouping != null && grouping.GroupExpressions != null && grouping.GroupExpressions.Count > 0) { AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = grouping.GroupExpressions[0]; if (expressionInfo.Type == AspNetCore.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Field) { AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet dataSet2 = memberDef.DataRegionDef.GetDataSet(reportDefinition); AspNetCore.ReportingServices.ReportIntermediateFormat.Field field = dataSet2.Fields[expressionInfo.IntValue]; if (field.DataField != null) { string dataField = field.DataField; object second = dataRegionMemberInstance.GroupExprValues[0]; PairObj <string, object> pairObj = this.m_specialLastGroupingValues[j]; if (pairObj == null) { pairObj = new PairObj <string, object>(dataField, second); this.m_specialLastGroupingValues[j] = pairObj; } else { pairObj.First = dataField; pairObj.Second = second; } } } } } else { num3 = j + 1; } } break; case InstancePathItemType.None: break; } } if (mode == OnDemandMode.FullSetup && !flag3 && scopeInstance != null && num3 > 0) { while (num3 < this.m_lastInstancePath.Count) { if (!this.m_lastInstancePath[num3].IsScope) { num3++; continue; } scopeInstance.SetupFields(base.m_odpContext, base.m_odpContext.CurrentDataSetIndex); break; } } if (mode == OnDemandMode.FullSetup && !base.m_odpContext.IsTablixProcessingMode && base.m_odpContext.CurrentReportInstance != null && dataRegionInstance == null && reportDefinition.DataSetsNotOnlyUsedInParameters == 1) { AspNetCore.ReportingServices.ReportIntermediateFormat.DataSet firstDataSet = reportDefinition.FirstDataSet; AspNetCore.ReportingServices.ReportIntermediateFormat.DataSetInstance dataSetInstance2 = base.m_odpContext.CurrentReportInstance.GetDataSetInstance(firstDataSet, base.m_odpContext); if (dataSetInstance2 != null) { bool flag5 = true; if (!base.m_odpContext.IsTablixProcessingComplete(firstDataSet.IndexInCollection)) { this.PerformOnDemandTablixProcessing(firstDataSet); flag5 = false; } if (base.m_odpContext.CurrentOdpDataSetInstance == dataSetInstance2) { flag5 = false; } if (flag5) { dataSetInstance2.SetupEnvironment(base.m_odpContext, true); } else if (!dataSetInstance2.NoRows) { dataSetInstance2.SetupFields(base.m_odpContext, dataSetInstance2); } } } } } finally { if (needDeepCopyPath) { InstancePathItem.DeepCopyPath(list, ref this.m_lastInstancePath); } } }
private void addScopeResolver <T>(IServiceCollection services) { var instance = new ScopeInstance <T>(); services.Add(instance); }
private void SetupObjectModels(OnDemandMode mode, bool needDeepCopyPath, int moveNextInstanceIndex, string scopeName) { Microsoft.ReportingServices.ReportIntermediateFormat.DataRegionInstance dataRegionInstance = null; IMemberHierarchy memberHierarchy = null; int num = -1; ScopeInstance scopeInstance = m_odpContext.CurrentReportInstance; List <InstancePathItem> lastInstancePath = m_lastInstancePath; List <InstancePathItem> list = null; int num2 = 0; Microsoft.ReportingServices.ReportIntermediateFormat.Report reportDefinition = m_odpContext.ReportDefinition; ObjectModelImpl reportObjectModel = m_odpContext.ReportObjectModel; bool flag = false; bool flag2 = false; int i = 0; try { if (m_lastRIFObject.InstancePath != null) { list = m_lastRIFObject.InstancePath; num2 = list.Count; } if (mode != OnDemandMode.InScope) { m_odpContext.EnsureCultureIsSetOnCurrentThread(); } if (mode == OnDemandMode.InScope && 1 == reportDefinition.DataSetsNotOnlyUsedInParameters && InScopeCompare(reportDefinition.FirstDataSet.Name, scopeName)) { return; } int num3 = 0; if (m_odpContext.InSubreport) { num3 = InstancePathItem.GetParentReportIndex(m_lastRIFObject.InstancePath, m_lastRIFObject.InstancePathItem.Type == InstancePathItemType.SubReport); } bool identicalPaths; int sharedPathIndex = InstancePathItem.GetSharedPathIndex(num3, lastInstancePath, list, reportObjectModel.AllFieldsCleared, out identicalPaths); for (int j = m_specialLastGroupingValues.Count; j < num3; j++) { m_specialLastGroupingValues.Add(null); } for (int k = num3; k < num2; k++) { InstancePathItem instancePathItem = list[k]; bool flag3 = false; if (mode != OnDemandMode.InScope) { flag3 = (k <= sharedPathIndex); } if (!flag3 && mode == OnDemandMode.FullSetup) { if (m_specialLastGroupingValues.Count < num2) { m_specialLastGroupingValues.Add(null); } else { m_specialLastGroupingValues[k] = null; } } switch (instancePathItem.Type) { case InstancePathItemType.SubReport: { if (scopeInstance.SubreportInstances == null || instancePathItem.IndexInCollection >= scopeInstance.SubreportInstances.Count) { break; } IReference <Microsoft.ReportingServices.ReportIntermediateFormat.SubReportInstance> reference = scopeInstance.SubreportInstances[instancePathItem.IndexInCollection]; using (reference.PinValue()) { Microsoft.ReportingServices.ReportIntermediateFormat.SubReportInstance subReportInstance = reference.Value(); subReportInstance.SubReportDef.CurrentSubReportInstance = reference; if (mode != OnDemandMode.InScope && !subReportInstance.Initialized) { if (m_odpContext.IsTablixProcessingMode || m_odpContext.IsTopLevelSubReportProcessing) { return; } SubReportInitializer.InitializeSubReport(subReportInstance.SubReportDef); reference.PinValue(); } Global.Tracer.Assert(k == num2 - 1, "SubReport not last in instance path."); } break; } case InstancePathItemType.DataRegion: if (scopeInstance is Microsoft.ReportingServices.ReportIntermediateFormat.ReportInstance && (scopeInstance.DataRegionInstances == null || scopeInstance.DataRegionInstances.Count <= instancePathItem.IndexInCollection || scopeInstance.DataRegionInstances[instancePathItem.IndexInCollection] == null || scopeInstance.DataRegionInstances[instancePathItem.IndexInCollection].Value() == null)) { Global.Tracer.Assert(instancePathItem.IndexInCollection < reportDefinition.TopLevelDataRegions.Count, "(newItem.IndexInCollection < m_reportDefinition.TopLevelDataRegions.Count)"); Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet = reportDefinition.TopLevelDataRegions[instancePathItem.IndexInCollection].GetDataSet(reportDefinition); if (mode == OnDemandMode.InScope && InScopeCompare(dataSet.Name, scopeName)) { return; } PerformOnDemandTablixProcessing(dataSet); } scopeInstance = scopeInstance.DataRegionInstances[instancePathItem.IndexInCollection].Value(); flag = (m_inRecursiveColumnHierarchy = false); flag2 = (m_inRecursiveRowHierarchy = false); num = -1; dataRegionInstance = (scopeInstance as Microsoft.ReportingServices.ReportIntermediateFormat.DataRegionInstance); memberHierarchy = dataRegionInstance; if (mode == OnDemandMode.InScope && InScopeCompare(dataRegionInstance.DataRegionDef.Name, scopeName)) { return; } if (dataRegionInstance.DataSetIndexInCollection >= 0 && m_odpContext.CurrentDataSetIndex != dataRegionInstance.DataSetIndexInCollection && mode != OnDemandMode.InScope) { if (!flag3) { Microsoft.ReportingServices.ReportIntermediateFormat.DataSetInstance dataSetInstance = m_odpContext.CurrentReportInstance.GetDataSetInstance(dataRegionInstance.DataSetIndexInCollection, m_odpContext); if (dataSetInstance != null) { dataSetInstance.SetupEnvironment(m_odpContext, newDataSetDefinition: true); i = 0; } } else { i = k + 1; } } if (mode == OnDemandMode.InScope) { break; } if (!flag3) { dataRegionInstance.SetupEnvironment(m_odpContext); i = 0; if (dataRegionInstance.NoRows) { dataRegionInstance.DataRegionDef.NoRows = true; dataRegionInstance.DataRegionDef.ResetTopLevelDynamicMemberInstanceCount(); return; } dataRegionInstance.DataRegionDef.NoRows = false; } else { i = k + 1; } break; case InstancePathItemType.ColumnMemberInstanceIndexTopMost: scopeInstance = dataRegionInstance; break; case InstancePathItemType.Cell: { if (-1 == num) { num = 0; } IList <Microsoft.ReportingServices.ReportIntermediateFormat.DataCellInstance> cellInstances = memberHierarchy.GetCellInstances(num); if (cellInstances == null) { if (flag2 && flag) { reportObjectModel.ResetFieldValues(); } } else { if (cellInstances.Count <= instancePathItem.IndexInCollection) { break; } Microsoft.ReportingServices.ReportIntermediateFormat.DataCellInstance dataCellInstance = cellInstances[instancePathItem.IndexInCollection]; if (dataCellInstance != null) { scopeInstance = dataCellInstance; if (!flag3) { dataCellInstance.SetupEnvironment(m_odpContext, m_odpContext.CurrentDataSetIndex); i = 0; } else { i = k + 1; } } } break; } case InstancePathItemType.None: continue; } if (!instancePathItem.IsDynamicMember) { continue; } IList <DataRegionMemberInstance> childMemberInstances = ((IMemberHierarchy)scopeInstance).GetChildMemberInstances(instancePathItem.Type == InstancePathItemType.RowMemberInstanceIndex, instancePathItem.IndexInCollection); if (childMemberInstances == null) { reportObjectModel.ResetFieldValues(); return; } int num4 = (k != num2 - 1 || moveNextInstanceIndex < 0 || moveNextInstanceIndex >= childMemberInstances.Count) ? ((instancePathItem.InstanceIndex >= 0) ? instancePathItem.InstanceIndex : 0) : moveNextInstanceIndex; if (num4 >= childMemberInstances.Count) { instancePathItem.ResetContext(); num4 = 0; } DataRegionMemberInstance dataRegionMemberInstance = childMemberInstances[num4]; if (mode == OnDemandMode.FullSetup) { dataRegionMemberInstance.MemberDef.InstanceCount = childMemberInstances.Count; dataRegionMemberInstance.MemberDef.CurrentMemberIndex = num4; } scopeInstance = dataRegionMemberInstance; m_lastRecursiveLevel = dataRegionMemberInstance.RecursiveLevel; Microsoft.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode memberDef = dataRegionMemberInstance.MemberDef; if (mode == OnDemandMode.InScope && InScopeCompare(memberDef.Grouping.Name, scopeName)) { return; } if (instancePathItem.Type == InstancePathItemType.RowMemberInstanceIndex) { memberHierarchy = dataRegionMemberInstance; flag2 = true; } else { num = dataRegionMemberInstance.MemberInstanceIndexWithinScopeLevel; flag = true; } if (mode == OnDemandMode.FullSetup && !flag3) { dataRegionMemberInstance.SetupEnvironment(m_odpContext, m_odpContext.CurrentDataSetIndex); i = 0; Microsoft.ReportingServices.ReportIntermediateFormat.Grouping grouping = memberDef.Grouping; if (grouping.Parent != null) { if (memberDef.IsColumn) { m_inRecursiveColumnHierarchy = true; } else { m_inRecursiveRowHierarchy = true; } if (memberDef.IsTablixMember) { memberDef.SetMemberInstances(childMemberInstances); memberDef.SetRecursiveParentIndex(dataRegionMemberInstance.RecursiveParentIndex); memberDef.SetInstanceHasRecursiveChildren(dataRegionMemberInstance.HasRecursiveChildren); } } else if (memberDef.IsColumn) { m_inRecursiveColumnHierarchy = false; } else { m_inRecursiveRowHierarchy = false; } grouping.RecursiveLevel = m_lastRecursiveLevel; grouping.SetGroupInstanceExpressionValues(dataRegionMemberInstance.GroupExprValues); if (mode != 0 || grouping == null || grouping.GroupExpressions == null || grouping.GroupExpressions.Count <= 0) { continue; } Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo expressionInfo = grouping.GroupExpressions[0]; if (expressionInfo.Type != Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo.Types.Field) { continue; } Microsoft.ReportingServices.ReportIntermediateFormat.Field field = memberDef.DataRegionDef.GetDataSet(reportDefinition).Fields[expressionInfo.IntValue]; if (field.DataField != null) { string dataField = field.DataField; object second = dataRegionMemberInstance.GroupExprValues[0]; PairObj <string, object> pairObj = m_specialLastGroupingValues[k]; if (pairObj == null) { pairObj = new PairObj <string, object>(dataField, second); m_specialLastGroupingValues[k] = pairObj; } else { pairObj.First = dataField; pairObj.Second = second; } } } else { i = k + 1; } } if (mode == OnDemandMode.FullSetup && !identicalPaths && scopeInstance != null && i > 0) { for (; i < m_lastInstancePath.Count; i++) { if (m_lastInstancePath[i].IsScope) { scopeInstance.SetupFields(m_odpContext, m_odpContext.CurrentDataSetIndex); break; } } } if (mode != 0 || m_odpContext.IsTablixProcessingMode || m_odpContext.CurrentReportInstance == null || dataRegionInstance != null || reportDefinition.DataSetsNotOnlyUsedInParameters != 1) { return; } Microsoft.ReportingServices.ReportIntermediateFormat.DataSet firstDataSet = reportDefinition.FirstDataSet; Microsoft.ReportingServices.ReportIntermediateFormat.DataSetInstance dataSetInstance2 = m_odpContext.CurrentReportInstance.GetDataSetInstance(firstDataSet, m_odpContext); if (dataSetInstance2 != null) { bool flag4 = true; if (!m_odpContext.IsTablixProcessingComplete(firstDataSet.IndexInCollection)) { PerformOnDemandTablixProcessing(firstDataSet); flag4 = false; } if (m_odpContext.CurrentOdpDataSetInstance == dataSetInstance2) { flag4 = false; } if (flag4) { dataSetInstance2.SetupEnvironment(m_odpContext, newDataSetDefinition: true); } else if (!dataSetInstance2.NoRows) { dataSetInstance2.SetupFields(m_odpContext, dataSetInstance2); } } } finally { if (needDeepCopyPath) { InstancePathItem.DeepCopyPath(list, ref m_lastInstancePath); } } }