Ejemplo n.º 1
0
 internal void UnRegisterDataRegion(Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegion)
 {
     m_activeScopes       = m_activeScopes.Rest;
     m_activeRowScopes    = m_activeRowScopes.Rest;
     m_activeColumnScopes = m_activeColumnScopes.Rest;
     m_dataRegionScopes   = m_dataRegionScopes.Rest;
 }
Ejemplo n.º 2
0
 internal RuntimeDetailObj(RuntimeDetailObj detailRoot, Microsoft.ReportingServices.ReportProcessing.ObjectType objectType)
     : base(detailRoot.OdpContext, objectType, detailRoot.Depth)
 {
     m_hierarchyRoot = (RuntimeDetailObjReference)detailRoot.SelfReference;
     m_outerScope    = detailRoot.m_outerScope;
     m_dataRegionDef = detailRoot.m_dataRegionDef;
 }
Ejemplo n.º 3
0
 protected RuntimeDetailObj(IReference <IScope> outerScope, Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef, DataActions dataAction, OnDemandProcessingContext odpContext, Microsoft.ReportingServices.ReportProcessing.ObjectType objectType)
     : base(odpContext, objectType, (outerScope == null) ? dataRegionDef.InnerGroupingDynamicMemberCount : (outerScope.Value().Depth + 1))
 {
     m_hierarchyRoot   = (RuntimeDetailObjReference)base.SelfReference;
     m_outerScope      = outerScope;
     m_dataRegionDef   = dataRegionDef;
     m_outerDataAction = dataAction;
 }
Ejemplo n.º 4
0
 public IOnDemandMemberOwnerInstanceReference GetDataRegionInstance(Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion rifDataRegion)
 {
     if (m_runtimeDataRegions == null)
     {
         return(null);
     }
     return(m_runtimeDataRegions.GetDataRegionObj(rifDataRegion));
 }
 protected bool DataRegionInScope(Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef, string scope)
 {
     if (dataRegionDef.ScopeNames == null)
     {
         dataRegionDef.ScopeNames = GetScopeNames(SelfReference, scope, out bool inScope);
         return(inScope);
     }
     return(dataRegionDef.ScopeNames.Contains(scope));
 }
        private void AddDataRegion(RuntimeDataTablixObj dataRegion, Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef)
        {
            RuntimeDataTablixObjReference runtimeDataTablixObjReference = (RuntimeDataTablixObjReference)dataRegion.SelfReference;

            runtimeDataTablixObjReference.UnPinValue();
            int indexInCollection = dataRegionDef.IndexInCollection;

            ListUtils.AdjustLength(m_dataRegionObjs, indexInCollection);
            m_dataRegionObjs[indexInCollection] = runtimeDataTablixObjReference;
        }
Ejemplo n.º 7
0
		internal void CalculateRunningValues(Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef, Dictionary<string, IReference<RuntimeGroupRootObj>> groupCol, IReference<RuntimeGroupRootObj> lastGroup, IReference<RuntimeDataTablixGroupLeafObj> owner, AggregateUpdateContext aggContext)
		{
			IDisposable cleanupRef;
			RuntimeCell orCreateCell = GetOrCreateCell(dataRegionDef, owner, dataRegionDef.CurrentOuterGroupRoot, out cleanupRef);
			if (orCreateCell != null)
			{
				orCreateCell.CalculateRunningValues(groupCol, lastGroup, aggContext);
				cleanupRef?.Dispose();
			}
		}
Ejemplo n.º 8
0
 internal void RegisterDataRegion(Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegion)
 {
     if (!m_scopes.TryGetValue(dataRegion, out ScopeTreeNode value))
     {
         value = new SubScopeNode(dataRegion, m_activeScopes.First);
     }
     AddScope(value);
     m_dataRegionScopes   = m_dataRegionScopes.Add(value);
     m_activeRowScopes    = m_activeRowScopes.Add(null);
     m_activeColumnScopes = m_activeColumnScopes.Add(null);
 }
Ejemplo n.º 9
0
 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);
     }
 }
 public IReference <IDataCorrelation> GetIdcReceiver(IRIFReportDataScope scope)
 {
     if (scope.IsGroup)
     {
         Microsoft.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode rifMember = scope as Microsoft.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode;
         IReference <RuntimeMemberObj>[] memberCollection = GetMemberCollection(rifMember);
         return(RuntimeDataRegionObj.GetGroupRoot(rifMember, memberCollection));
     }
     Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion rifDataRegion = scope as Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion;
     return(GetNestedDataRegion(rifDataRegion));
 }
        internal RuntimeDataTablixObj(IReference <IScope> outerScope, Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataTablixDef, ref DataActions dataAction, OnDemandProcessingContext odpContext, bool onePassProcess, Microsoft.ReportingServices.ReportProcessing.ObjectType objectType)
            : base(outerScope, dataTablixDef, ref dataAction, odpContext, onePassProcess, dataTablixDef.RunningValues, objectType, outerScope.Value().Depth + 1)
        {
            ConstructorHelper(ref dataAction, onePassProcess, out bool handleMyDataAction, out DataActions innerDataAction);
            m_innerDataAction = innerDataAction;
            DataActions userSortDataAction = HandleSortFilterEvent();

            ConstructRuntimeStructure(ref innerDataAction, onePassProcess);
            HandleDataAction(handleMyDataAction, innerDataAction, userSortDataAction);
            m_odpContext.CreatedScopeInstance(m_dataRegionDef);
            m_scopeInstanceNumber = RuntimeDataRegionObj.AssignScopeInstanceNumber(m_dataRegionDef.DataScopeInfo);
        }
 protected int DataRegionRecursiveLevel(Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef, string scope)
 {
     if (scope == null)
     {
         return(-1);
     }
     if (dataRegionDef.ScopeNames == null)
     {
         dataRegionDef.ScopeNames = GetScopeNames(SelfReference, scope, out int level);
         return(level);
     }
     return((dataRegionDef.ScopeNames[scope] as Microsoft.ReportingServices.ReportIntermediateFormat.Grouping)?.RecursiveLevel ?? (-1));
 }
Ejemplo n.º 13
0
        public override void Deserialize(IntermediateFormatReader reader)
        {
            base.Deserialize(reader);
            reader.RegisterDeclaration(m_declaration);
            IScalabilityCache scalabilityCache = reader.PersistenceHelper as IScalabilityCache;

            while (reader.NextMember())
            {
                switch (reader.CurrentMember.MemberName)
                {
                case MemberName.OuterScope:
                    m_outerScope = (IReference <IScope>)reader.ReadRIFObject();
                    break;

                case MemberName.DataRegionDef:
                {
                    int id = reader.ReadInt32();
                    m_dataRegionDef = (Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion)scalabilityCache.FetchStaticReference(id);
                    break;
                }

                case MemberName.DataRows:
                    m_dataRows = reader.ReadRIFObject <ScalableList <DataFieldRow> >();
                    break;

                case MemberName.RunningValueValues:
                    m_rvValueList = reader.ReadListOfRIFObjectArrays <Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObjResult>();
                    break;

                case MemberName.RunningValuesInGroup:
                    m_runningValuesInGroup = reader.ReadListOfPrimitives <string>();
                    break;

                case MemberName.PreviousValuesInGroup:
                    m_previousValuesInGroup = reader.ReadListOfPrimitives <string>();
                    break;

                case MemberName.GroupCollection:
                    m_groupCollection = reader.ReadStringRIFObjectDictionary <IReference <RuntimeGroupRootObj> >();
                    break;

                case MemberName.OuterDataAction:
                    m_outerDataAction = (DataActions)reader.ReadEnum();
                    break;

                default:
                    Global.Tracer.Assert(condition: false);
                    break;
                }
            }
        }
        protected void DataRegionGetGroupNameValuePairs(Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef, Dictionary <string, object> nameValuePairs)
        {
            if (dataRegionDef.ScopeNames == null)
            {
                dataRegionDef.ScopeNames = GetScopeNames(SelfReference, nameValuePairs);
                return;
            }
            IEnumerator enumerator = dataRegionDef.ScopeNames.Values.GetEnumerator();

            while (enumerator.MoveNext())
            {
                AddGroupNameValuePair(m_odpContext, enumerator.Current as Microsoft.ReportingServices.ReportIntermediateFormat.Grouping, nameValuePairs);
            }
        }
Ejemplo n.º 15
0
        internal Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion GetParentDataRegion(IRIFDataScope scope)
        {
            Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion parentDataRegion = null;
            DirectedScopeTreeVisitor visitor = delegate(IRIFDataScope candidate)
            {
                if (candidate != scope)
                {
                    parentDataRegion = (candidate as Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion);
                }
                return(parentDataRegion == null);
            };

            Traverse(visitor, scope);
            return(parentDataRegion);
        }
Ejemplo n.º 16
0
 public int[] GetRepeatSiblings()
 {
     if (m_isOldSnapshot)
     {
         return(((Microsoft.ReportingServices.ReportRendering.DataRegion)m_renderReportItem).GetRepeatSiblings());
     }
     Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegion = (Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion)base.ReportItemDef;
     if (dataRegion.RepeatSiblings == null)
     {
         return(new int[0]);
     }
     int[] array = new int[dataRegion.RepeatSiblings.Count];
     dataRegion.RepeatSiblings.CopyTo(array);
     return(array);
 }
 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;
         }
     }
 }
 internal AutomaticSubtotalContext(Microsoft.ReportingServices.ReportIntermediateFormat.Report report, List <ICreateSubtotals> createSubtotals, List <Microsoft.ReportingServices.ReportIntermediateFormat.Grouping> domainScopeGroups, NameValidator reportItemNameValidator, NameValidator scopeNameValidator, NameValidator variableNameValidator, Dictionary <string, Microsoft.ReportingServices.ReportIntermediateFormat.ISortFilterScope> reportScopes, List <Microsoft.ReportingServices.ReportIntermediateFormat.ReportItemCollection> reportItemCollections, List <Microsoft.ReportingServices.ReportIntermediateFormat.IAggregateHolder> aggregateHolders, List <Microsoft.ReportingServices.ReportIntermediateFormat.IRunningValueHolder> runningValueHolders, Holder <int> variableSequenceIdCounter, Holder <int> textboxSequenceIdCounter, ScopeTree scopeTree)
 {
     m_createSubtotals         = createSubtotals;
     m_domainScopeGroups       = domainScopeGroups;
     m_reportItemNameValidator = reportItemNameValidator;
     m_scopeNameValidator      = scopeNameValidator;
     m_variableNameValidator   = variableNameValidator;
     m_report = report;
     m_variableSequenceIdCounter        = variableSequenceIdCounter;
     m_textboxSequenceIdCounter         = textboxSequenceIdCounter;
     m_dynamicWithStaticPeerEncountered = false;
     m_location          = LocationFlags.None;
     m_objectName        = null;
     m_objectType        = ObjectType.Tablix;
     m_currentDataRegion = null;
     m_cellLists         = null;
     m_tablixColumns     = null;
     m_rows                                = null;
     m_scopeNameMap                        = new Dictionary <string, string>(StringComparer.Ordinal);
     m_reportItemNameMap                   = new Dictionary <string, string>(StringComparer.Ordinal);
     m_aggregateMap                        = new Dictionary <string, string>(StringComparer.Ordinal);
     m_lookupMap                           = new Dictionary <string, string>(StringComparer.Ordinal);
     m_variableNameMap                     = new Dictionary <string, string>(StringComparer.Ordinal);
     m_currentScope                        = null;
     m_currentScopeBeingCloned             = null;
     m_startIndex                          = new Holder <int>();
     m_currentIndex                        = new Holder <int>();
     m_headerLevel                         = 0;
     m_originalColumnCount                 = 0;
     m_originalRowCount                    = 0;
     m_reportScopes                        = reportScopes;
     m_reportItemCollections               = reportItemCollections;
     m_aggregateHolders                    = aggregateHolders;
     m_runningValueHolders                 = runningValueHolders;
     m_expressionsWithReportItemReferences = new List <Microsoft.ReportingServices.ReportIntermediateFormat.ExpressionInfo>();
     m_visibilitiesWithToggleToUpdate      = new List <Microsoft.ReportingServices.ReportIntermediateFormat.Visibility>();
     m_reportItemsWithRepeatWithToUpdate   = new List <Microsoft.ReportingServices.ReportIntermediateFormat.ReportItem>();
     m_endUserSortWithTarget               = new List <Microsoft.ReportingServices.ReportIntermediateFormat.EndUserSort>();
     m_scopeNamesToClone                   = new Dictionary <string, IRIFDataScope>(StringComparer.Ordinal);
     m_headerLevelHasStaticArray           = null;
     m_currentDataRegionClone              = null;
     m_currentMapClone                     = null;
     m_outerAggregate                      = null;
     m_scopeTree                           = scopeTree;
     m_currentDataScope                    = null;
     m_currentMapVectorLayerClone          = null;
 }
Ejemplo n.º 19
0
		private RuntimeCell GetOrCreateCellByIndex(int groupLeafIndex, Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef, IReference<RuntimeDataTablixGroupLeafObj> ownerRef, RuntimeDataTablixGroupRootObj currOuterGroupRoot, out IDisposable cleanupRef)
		{
			RuntimeCell andPinCell = GetAndPinCell(groupLeafIndex, out cleanupRef);
			if (andPinCell == null)
			{
				using (ownerRef.PinValue())
				{
					RuntimeDataTablixGroupLeafObj runtimeDataTablixGroupLeafObj = ownerRef.Value();
					if (!RuntimeCell.HasOnlySimpleGroupTreeCells(currOuterGroupRoot.HierarchyDef, runtimeDataTablixGroupLeafObj.MemberDef, dataRegionDef))
					{
						runtimeDataTablixGroupLeafObj.CreateCell(this, groupLeafIndex, currOuterGroupRoot.HierarchyDef, runtimeDataTablixGroupLeafObj.MemberDef, dataRegionDef);
					}
				}
				andPinCell = GetAndPinCell(groupLeafIndex, out cleanupRef);
			}
			return andPinCell;
		}
 internal RuntimeRDLDataRegionObj(IReference<IScope> outerScope, Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef, ref DataActions dataAction, OnDemandProcessingContext odpContext, bool onePassProcess, List<Microsoft.ReportingServices.ReportIntermediateFormat.RunningValueInfo> runningValues, Microsoft.ReportingServices.ReportProcessing.ObjectType objectType, int level)
     : base(odpContext, objectType, level)
 {
     m_dataRegionDef = dataRegionDef;
     m_outerScope = outerScope;
     RuntimeDataRegionObj.CreateAggregates(m_odpContext, dataRegionDef.Aggregates, ref m_nonCustomAggregates, ref m_customAggregates);
     if (dataRegionDef.DataScopeInfo != null)
     {
         RuntimeDataRegionObj.CreateAggregates(m_odpContext, dataRegionDef.DataScopeInfo.AggregatesOfAggregates, ref m_aggregatesOfAggregates);
     }
     if (dataRegionDef.Filters != null)
     {
         m_filters = new Filters(Filters.FilterTypes.DataRegionFilter, (IReference<Microsoft.ReportingServices.ReportProcessing.ReportProcessing.IFilterOwner>)base.SelfReference, dataRegionDef.Filters, dataRegionDef.ObjectType, dataRegionDef.Name, m_odpContext, level + 1);
         return;
     }
     m_outerDataAction = dataAction;
     m_dataAction = dataAction;
     dataAction = DataActions.None;
 }
        internal string GetNewScopeNameForInnerOrOuterAggregate(Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo originalAggregate)
        {
            string scope = originalAggregate.PublishingInfo.Scope;

            if (m_scopeNamesToClone.TryGetValue(scope, out IRIFDataScope value))
            {
                Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegion = value as Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion;
                if (dataRegion != null)
                {
                    return(CreateUniqueReportItemName(scope, dataRegion.IsClone));
                }
                Microsoft.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode reportHierarchyNode = value as Microsoft.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode;
                if (reportHierarchyNode != null)
                {
                    return(CreateAndRegisterUniqueGroupName(scope, reportHierarchyNode.IsClone));
                }
                Global.Tracer.Assert(false, "Unknown object type in GetNewScopeNameForNestedAggregate: {0}", value);
                return(scope);
            }
            IRIFDataScope scopeByName = m_scopeTree.GetScopeByName(m_currentScope);
            int           num         = (scopeByName == null || !NeedsSubtotalScopeLift(originalAggregate, scopeByName)) ? (-1) : m_scopeTree.MeasureScopeDistance(m_currentScopeBeingCloned, m_currentScope);

            if (num <= 0)
            {
                return(scope);
            }
            string text = m_scopeTree.FindAncestorScopeName(scope, num);

            if (text == null)
            {
                return(scope);
            }
            if (m_outerAggregate != null && !string.IsNullOrEmpty(m_outerAggregate.PublishingInfo.Scope))
            {
                IRIFDataScope scopeByName2 = m_scopeTree.GetScopeByName(m_outerAggregate.PublishingInfo.Scope);
                IRIFDataScope scopeByName3 = m_scopeTree.GetScopeByName(text);
                if (scopeByName2 != null && scopeByName3 != null && m_scopeTree.IsParentScope(scopeByName3, scopeByName2))
                {
                    text = m_outerAggregate.PublishingInfo.Scope;
                }
            }
            return(text);
        }
 protected void DetailHandleSortFilterEvent(Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef, IReference <IScope> outerScope, bool isColumnAxis, int rowIndex)
 {
     using (outerScope.PinValue())
     {
         IScope scope = outerScope.Value();
         List <IReference <RuntimeSortFilterEventInfo> > runtimeSortFilterInfo = m_odpContext.RuntimeSortFilterInfo;
         if (runtimeSortFilterInfo == null || dataRegionDef.SortFilterSourceDetailScopeInfo == null || scope.TargetForNonDetailSort)
         {
             return;
         }
         int count = runtimeSortFilterInfo.Count;
         for (int i = 0; i < count; i++)
         {
             IReference <RuntimeSortFilterEventInfo> reference = runtimeSortFilterInfo[i];
             using (reference.PinValue())
             {
                 RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = reference.Value();
                 if (runtimeSortFilterEventInfo.EventSource.ContainingScopes == null || 0 >= runtimeSortFilterEventInfo.EventSource.ContainingScopes.Count || -1 == dataRegionDef.SortFilterSourceDetailScopeInfo[i] || !scope.TargetScopeMatched(i, detailSort: false) || m_odpContext.ReportObjectModel.FieldsImpl.GetRowIndex() != dataRegionDef.SortFilterSourceDetailScopeInfo[i])
                 {
                     continue;
                 }
                 if (runtimeSortFilterEventInfo.EventSource.ContainingScopes.LastEntry == null)
                 {
                     Microsoft.ReportingServices.ReportIntermediateFormat.ReportItem parent = runtimeSortFilterEventInfo.EventSource.Parent;
                     if (runtimeSortFilterEventInfo.EventSource.IsSubReportTopLevelScope)
                     {
                         while (parent != null && !(parent is Microsoft.ReportingServices.ReportIntermediateFormat.SubReport))
                         {
                             parent = parent.Parent;
                         }
                         Global.Tracer.Assert(parent is Microsoft.ReportingServices.ReportIntermediateFormat.SubReport, "(parent is SubReport)");
                         parent = parent.Parent;
                     }
                     if (parent == dataRegionDef)
                     {
                         runtimeSortFilterEventInfo.SetEventSourceScope(isColumnAxis, SelfReference, rowIndex);
                     }
                 }
                 runtimeSortFilterEventInfo.AddDetailScopeInfo(isColumnAxis, SelfReference, rowIndex);
             }
         }
     }
 }
 protected bool DetailTargetScopeMatched(Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegionDef, IReference <IScope> outerScope, bool isColumnAxis, int index)
 {
     if (m_odpContext.RuntimeSortFilterInfo != null)
     {
         IReference <RuntimeSortFilterEventInfo> reference = m_odpContext.RuntimeSortFilterInfo[index];
         using (reference.PinValue())
         {
             RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = reference.Value();
             if (runtimeSortFilterEventInfo != null)
             {
                 List <IReference <RuntimeDataRegionObj> > list = null;
                 List <int> list2 = null;
                 int        num   = -1;
                 if (isColumnAxis)
                 {
                     list  = runtimeSortFilterEventInfo.DetailColScopes;
                     list2 = runtimeSortFilterEventInfo.DetailColScopeIndices;
                     num   = dataRegionDef.CurrentColDetailIndex;
                 }
                 else
                 {
                     list  = runtimeSortFilterEventInfo.DetailRowScopes;
                     list2 = runtimeSortFilterEventInfo.DetailRowScopeIndices;
                     num   = dataRegionDef.CurrentRowDetailIndex;
                 }
                 if (list != null)
                 {
                     for (int i = 0; i < list.Count; i++)
                     {
                         if (SelfReference.Equals(list[i]) && num == list2[i])
                         {
                             return(true);
                         }
                     }
                 }
             }
         }
     }
     return(false);
 }
        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;
            }
            }
        }
 public override void Deserialize(IntermediateFormatReader reader)
 {
     base.Deserialize(reader);
     reader.RegisterDeclaration(m_declaration);
     IScalabilityCache scalabilityCache = reader.PersistenceHelper as IScalabilityCache;
     while (reader.NextMember())
     {
         switch (reader.CurrentMember.MemberName)
         {
         case MemberName.DataRegionDef:
         {
             int id2 = reader.ReadInt32();
             m_dataRegionDef = (Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion)scalabilityCache.FetchStaticReference(id2);
             break;
         }
         case MemberName.OuterScope:
             m_outerScope = (IReference<IScope>)reader.ReadRIFObject();
             break;
         case MemberName.FirstRow:
             m_firstRow = (DataFieldRow)reader.ReadRIFObject();
             break;
         case MemberName.FirstRowIsAggregate:
             m_firstRowIsAggregate = reader.ReadBoolean();
             break;
         case MemberName.Filters:
         {
             int id = reader.ReadInt32();
             m_filters = (Filters)scalabilityCache.FetchStaticReference(id);
             break;
         }
         case MemberName.NonCustomAggregates:
             m_nonCustomAggregates = reader.ReadListOfRIFObjects<List<Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj>>();
             break;
         case MemberName.CustomAggregates:
             m_customAggregates = reader.ReadListOfRIFObjects<List<Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj>>();
             break;
         case MemberName.DataAction:
             m_dataAction = (DataActions)reader.ReadEnum();
             break;
         case MemberName.OuterDataAction:
             m_outerDataAction = (DataActions)reader.ReadEnum();
             break;
         case MemberName.RunningValues:
             m_runningValues = reader.ReadListOfPrimitives<string>();
             break;
         case MemberName.PreviousValues:
             m_previousValues = reader.ReadListOfPrimitives<string>();
             break;
         case MemberName.RunningValueValues:
             m_runningValueValues = reader.ReadArrayOfRIFObjects<Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObjResult>();
             break;
         case MemberName.RunningValueOfAggregateValues:
             m_runningValueOfAggregateValues = reader.ReadArrayOfRIFObjects<Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObjResult>();
             break;
         case MemberName.PostSortAggregates:
             m_postSortAggregates = reader.ReadListOfRIFObjects<List<Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj>>();
             break;
         case MemberName.DataRows:
             m_dataRows = reader.ReadRIFObject<ScalableList<DataFieldRow>>();
             break;
         case MemberName.InnerDataAction:
             m_innerDataAction = (DataActions)reader.ReadEnum();
             break;
         case MemberName.UserSortTargetInfo:
             m_userSortTargetInfo = (RuntimeUserSortTargetInfo)reader.ReadRIFObject();
             break;
         case MemberName.SortFilterExpressionScopeInfoIndices:
             m_sortFilterExpressionScopeInfoIndices = reader.ReadInt32Array();
             break;
         case MemberName.InDataRowSortPhase:
             m_inDataRowSortPhase = reader.ReadBoolean();
             break;
         case MemberName.SortedDataRowTree:
             m_sortedDataRowTree = (BTree)reader.ReadRIFObject();
             break;
         case MemberName.DataRowSortExpression:
             m_dataRowSortExpression = (RuntimeExpressionInfo)reader.ReadRIFObject();
             break;
         case MemberName.AggregatesOfAggregates:
             m_aggregatesOfAggregates = (BucketedDataAggregateObjs)reader.ReadRIFObject();
             break;
         case MemberName.PostSortAggregatesOfAggregates:
             m_postSortAggregatesOfAggregates = (BucketedDataAggregateObjs)reader.ReadRIFObject();
             break;
         case MemberName.HasProcessedAggregateRow:
             m_hasProcessedAggregateRow = reader.ReadBoolean();
             break;
         default:
             Global.Tracer.Assert(condition: false);
             break;
         }
     }
 }
Ejemplo n.º 26
0
        private void BindScopeToInstance(IRIFReportDataScope reportDataScope)
        {
            if (reportDataScope.IsBoundToStreamingScopeInstance)
            {
                return;
            }
            if (!reportDataScope.IsScope)
            {
                IRIFReportDataScope parentReportScope = reportDataScope.ParentReportScope;
                EnsureScopeIsBound(parentReportScope);
                reportDataScope.BindToStreamingScopeInstance(parentReportScope.CurrentStreamingScopeInstance);
                return;
            }
            switch (reportDataScope.InstancePathItem.Type)
            {
            case InstancePathItemType.Cell:
                if (reportDataScope.IsDataIntersectionScope)
                {
                    IRIFReportIntersectionScope iRIFReportIntersectionScope = (IRIFReportIntersectionScope)reportDataScope;
                    IRIFReportDataScope         parentRowReportScope        = iRIFReportIntersectionScope.ParentRowReportScope;
                    if (!TryBindParentScope(reportDataScope, parentRowReportScope, out IReference <IOnDemandMemberInstance> parentScopeInst2))
                    {
                        break;
                    }
                    IRIFReportDataScope parentColumnReportScope = iRIFReportIntersectionScope.ParentColumnReportScope;
                    if (!TryBindParentScope(reportDataScope, parentColumnReportScope, out IReference <IOnDemandMemberInstance> parentScopeInst3))
                    {
                        break;
                    }
                    IReference <IOnDemandMemberInstance> reference;
                    IReference <IOnDemandMemberInstance> reference2;
                    if (!iRIFReportIntersectionScope.IsColumnOuterGrouping)
                    {
                        reference  = parentScopeInst2;
                        reference2 = parentScopeInst3;
                    }
                    else
                    {
                        reference  = parentScopeInst3;
                        reference2 = parentScopeInst2;
                    }
                    CheckForPrematureScopeInstance(reportDataScope);
                    IReference <IOnDemandScopeInstance> cellRef;
                    IOnDemandScopeInstance cellInstance = SyntheticTriangulatedCellReference.GetCellInstance(reference, reference2, out cellRef);
                    if (cellInstance == null && iRIFReportIntersectionScope.DataScopeInfo.NeedsIDC && TryProcessToCreateCell(iRIFReportIntersectionScope, (RuntimeDataTablixGroupLeafObjReference)reference2, (RuntimeDataTablixGroupLeafObjReference)reference))
                    {
                        cellInstance = SyntheticTriangulatedCellReference.GetCellInstance(reference, reference2, out cellRef);
                    }
                    if (cellInstance != null)
                    {
                        if (cellRef == null)
                        {
                            iRIFReportIntersectionScope.BindToStreamingScopeInstance(reference, reference2);
                            SetupEnvironment(reportDataScope, cellInstance, iRIFReportIntersectionScope.CurrentStreamingScopeInstance);
                        }
                        else
                        {
                            reportDataScope.BindToStreamingScopeInstance(cellRef);
                        }
                    }
                }
                else
                {
                    Global.Tracer.Assert(condition: false, "Non-intersection cell scopes are not yet supported by streaming ODP.");
                }
                break;

            case InstancePathItemType.ColumnMemberInstanceIndexTopMost:
            case InstancePathItemType.ColumnMemberInstanceIndex:
            case InstancePathItemType.RowMemberInstanceIndex:
            {
                IRIFReportDataScope parentReportScope3 = reportDataScope.ParentReportScope;
                if (!TryBindParentScope(reportDataScope, parentReportScope3, out IReference <IOnDemandMemberOwnerInstance> parentScopeInst4))
                {
                    break;
                }
                CheckForPrematureScopeInstance(reportDataScope);
                using (parentScopeInst4.PinValue())
                {
                    IOnDemandMemberOwnerInstance onDemandMemberOwnerInstance = parentScopeInst4.Value();
                    Microsoft.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode rifMember = (Microsoft.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode)reportDataScope;
                    IOnDemandMemberInstanceReference firstMemberInstance = onDemandMemberOwnerInstance.GetFirstMemberInstance(rifMember);
                    if (RequiresIdcProcessing(reportDataScope, firstMemberInstance, (IReference <IOnDemandScopeInstance>)parentScopeInst4))
                    {
                        firstMemberInstance = onDemandMemberOwnerInstance.GetFirstMemberInstance(rifMember);
                    }
                    reportDataScope.BindToStreamingScopeInstance(firstMemberInstance);
                }
                break;
            }

            case InstancePathItemType.DataRegion:
            {
                IRIFReportDataScope parentReportScope2 = reportDataScope.ParentReportScope;
                Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegion = (Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion)reportDataScope;
                if (parentReportScope2 == null)
                {
                    Microsoft.ReportingServices.ReportIntermediateFormat.DataSet dataSet = dataRegion.DataScopeInfo.DataSet;
                    DataPipelineManager orCreatePipelineManager = GetOrCreatePipelineManager(dataSet, dataRegion);
                    reportDataScope.BindToStreamingScopeInstance(orCreatePipelineManager.GroupTreeRoot.GetDataRegionInstance(dataRegion));
                }
                else
                {
                    if (!TryBindParentScope(reportDataScope, parentReportScope2, out IReference <IOnDemandScopeInstance> parentScopeInst))
                    {
                        break;
                    }
                    CheckForPrematureScopeInstance(reportDataScope);
                    using (parentScopeInst.PinValue())
                    {
                        IOnDemandScopeInstance onDemandScopeInstance           = parentScopeInst.Value();
                        IReference <IOnDemandScopeInstance> dataRegionInstance = onDemandScopeInstance.GetDataRegionInstance(dataRegion);
                        if (RequiresIdcProcessing(reportDataScope, dataRegionInstance, parentScopeInst))
                        {
                            dataRegionInstance = onDemandScopeInstance.GetDataRegionInstance(dataRegion);
                        }
                        reportDataScope.BindToStreamingScopeInstance(dataRegionInstance);
                    }
                }
                break;
            }

            default:
                Global.Tracer.Assert(false, "SetupObjectModels cannot handle IRIFReportDataScope of type: {0}", Enum.GetName(typeof(InstancePathItemType), reportDataScope.InstancePathItem.Type));
                break;
            }
        }
 internal abstract RuntimeDataTablixObjReference GetNestedDataRegion(Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion rifDataRegion);
 public IOnDemandMemberOwnerInstanceReference GetDataRegionInstance(Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion rifDataRegion)
 {
     return(GetNestedDataRegion(rifDataRegion));
 }
 internal bool PopulateRuntimeSortFilterEventInfo(OnDemandProcessingContext odpContext, Microsoft.ReportingServices.ReportIntermediateFormat.DataSet myDataSet)
 {
     if (odpContext.TopLevelContext.UserSortFilterInfo == null || odpContext.TopLevelContext.UserSortFilterInfo.OdpSortInfo == null || odpContext.TopLevelContext.OldSortFilterEventInfo == null)
     {
         return(false);
     }
     if (-1 != m_dataSetGlobalID)
     {
         return(false);
     }
     m_runtimeSortFilterInfo = null;
     EventInformation.OdpSortEventInfo odpSortInfo = odpContext.TopLevelContext.UserSortFilterInfo.OdpSortInfo;
     for (int i = 0; i < odpSortInfo.Count; i++)
     {
         string uniqueNameAt = odpSortInfo.GetUniqueNameAt(i);
         Microsoft.ReportingServices.ReportIntermediateFormat.SortFilterEventInfo sortFilterEventInfo = odpContext.TopLevelContext.OldSortFilterEventInfo[uniqueNameAt];
         if (sortFilterEventInfo == null || sortFilterEventInfo.EventSource.UserSort == null)
         {
             continue;
         }
         int num = sortFilterEventInfo.EventSource.UserSort.SubReportDataSetGlobalId;
         if (-1 == num)
         {
             num = sortFilterEventInfo.EventSource.UserSort.DataSet.GlobalID;
         }
         if (num == myDataSet.GlobalID)
         {
             if (m_runtimeSortFilterInfo == null)
             {
                 m_runtimeSortFilterInfo = new List <IReference <RuntimeSortFilterEventInfo> >();
             }
             RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = new RuntimeSortFilterEventInfo(sortFilterEventInfo.EventSource, uniqueNameAt, odpSortInfo.GetSortDirectionAt(i), sortFilterEventInfo.EventSourceScopeInfo, odpContext, (m_currentContainingScope == null) ? 1 : m_currentContainingScope.Value().Depth);
             runtimeSortFilterEventInfo.SelfReference.UnPinValue();
             m_runtimeSortFilterInfo.Add(runtimeSortFilterEventInfo.SelfReference);
         }
     }
     if (m_runtimeSortFilterInfo != null)
     {
         int count = m_runtimeSortFilterInfo.Count;
         for (int j = 0; j < count; j++)
         {
             IReference <RuntimeSortFilterEventInfo> reference = m_runtimeSortFilterInfo[j];
             using (reference.PinValue())
             {
                 RuntimeSortFilterEventInfo runtimeSortFilterEventInfo2 = reference.Value();
                 IInScopeEventSource        eventSource = runtimeSortFilterEventInfo2.EventSource;
                 Microsoft.ReportingServices.ReportIntermediateFormat.ISortFilterScope sortExpressionScope = eventSource.UserSort.SortExpressionScope;
                 if (sortExpressionScope != null)
                 {
                     sortExpressionScope.IsSortFilterExpressionScope = SetSortFilterInfo(sortExpressionScope.IsSortFilterExpressionScope, count, j);
                 }
                 Microsoft.ReportingServices.ReportIntermediateFormat.ISortFilterScope sortTarget = eventSource.UserSort.SortTarget;
                 if (sortTarget != null)
                 {
                     sortTarget.IsSortFilterTarget = SetSortFilterInfo(sortTarget.IsSortFilterTarget, count, j);
                 }
                 if (eventSource.ContainingScopes != null && 0 < eventSource.ContainingScopes.Count)
                 {
                     int num2 = 0;
                     int num3 = 0;
                     for (int k = 0; k < eventSource.ContainingScopes.Count; k++)
                     {
                         Microsoft.ReportingServices.ReportIntermediateFormat.Grouping grouping = eventSource.ContainingScopes[k];
                         if (grouping != null && grouping.IsDetail)
                         {
                             continue;
                         }
                         List <object> list = runtimeSortFilterEventInfo2.SortSourceScopeInfo[num2];
                         if (grouping != null)
                         {
                             if (grouping.SortFilterScopeInfo == null)
                             {
                                 grouping.SortFilterScopeInfo = new List <object> [count];
                                 for (int l = 0; l < count; l++)
                                 {
                                     grouping.SortFilterScopeInfo[l] = null;
                                 }
                                 grouping.SortFilterScopeIndex = new int[count];
                                 for (int m = 0; m < count; m++)
                                 {
                                     grouping.SortFilterScopeIndex[m] = -1;
                                 }
                             }
                             grouping.SortFilterScopeInfo[j]  = list;
                             grouping.SortFilterScopeIndex[j] = num2;
                         }
                         else
                         {
                             List <Microsoft.ReportingServices.ReportIntermediateFormat.SubReport> detailScopeSubReports = eventSource.UserSort.DetailScopeSubReports;
                             Microsoft.ReportingServices.ReportIntermediateFormat.ReportItem       reportItem            = (detailScopeSubReports == null || num3 >= detailScopeSubReports.Count) ? eventSource.Parent : detailScopeSubReports[num3++].Parent;
                             while (reportItem != null && !reportItem.IsDataRegion)
                             {
                                 reportItem = reportItem.Parent;
                             }
                             Global.Tracer.Assert(reportItem.IsDataRegion, "(parent.IsDataRegion)");
                             Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegion = (Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion)reportItem;
                             if (dataRegion.SortFilterSourceDetailScopeInfo == null)
                             {
                                 dataRegion.SortFilterSourceDetailScopeInfo = new int[count];
                                 for (int n = 0; n < count; n++)
                                 {
                                     dataRegion.SortFilterSourceDetailScopeInfo[n] = -1;
                                 }
                             }
                             Global.Tracer.Assert(list != null && 1 == list.Count, "(null != scopeValues && 1 == scopeValues.Count)");
                             dataRegion.SortFilterSourceDetailScopeInfo[j] = (int)list[0];
                         }
                         num2++;
                     }
                 }
                 Microsoft.ReportingServices.ReportIntermediateFormat.GroupingList groupsInSortTarget = eventSource.UserSort.GroupsInSortTarget;
                 if (groupsInSortTarget != null)
                 {
                     for (int num4 = 0; num4 < groupsInSortTarget.Count; num4++)
                     {
                         groupsInSortTarget[num4].NeedScopeInfoForSortFilterExpression = SetSortFilterInfo(groupsInSortTarget[num4].NeedScopeInfoForSortFilterExpression, count, j);
                     }
                 }
                 List <int> peerSortFilters = eventSource.GetPeerSortFilters(create: false);
                 if (peerSortFilters == null || peerSortFilters.Count == 0)
                 {
                     continue;
                 }
                 if (runtimeSortFilterEventInfo2.PeerSortFilters == null)
                 {
                     runtimeSortFilterEventInfo2.PeerSortFilters = new Hashtable();
                 }
                 for (int num5 = 0; num5 < peerSortFilters.Count; num5++)
                 {
                     if (eventSource.ID != peerSortFilters[num5])
                     {
                         runtimeSortFilterEventInfo2.PeerSortFilters.Add(peerSortFilters[num5], null);
                     }
                 }
             }
         }
     }
     return(true);
 }
Ejemplo n.º 30
0
 public override IOnDemandMemberOwnerInstanceReference GetDataRegionInstance(Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion rifDataRegion)
 {
     Global.Tracer.Assert(m_cellContents != null, "Cannot find data region.");
     return(m_cellContents.GetDataRegionObj(rifDataRegion));
 }