Esempio n. 1
0
 internal void Reset(Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo aggregateDef)
 {
     if (m_collection != null)
     {
         GetAggregateObj(aggregateDef.Name)?.ResetForNoRows();
     }
 }
Esempio n. 2
0
 internal void Remove(Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo aggDef)
 {
     try
     {
         if (m_lockAdd)
         {
             Monitor.Enter(m_collection);
         }
         if (m_collection == null)
         {
             return;
         }
         m_collection.Remove(aggDef.Name);
         List <string> duplicateNames = aggDef.DuplicateNames;
         if (m_duplicateNames != null && duplicateNames != null)
         {
             for (int i = 0; i < duplicateNames.Count; i++)
             {
                 m_duplicateNames.Remove(duplicateNames[i]);
             }
         }
     }
     finally
     {
         if (m_lockAdd)
         {
             Monitor.Exit(m_collection);
         }
     }
 }
Esempio n. 3
0
 internal void Set(string name, Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo aggregateDef, List <string> duplicateNames, Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObjResult aggregateResult)
 {
     Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj aggregateObj = GetAggregateObj(name);
     if (aggregateObj == null)
     {
         try
         {
             if (m_lockAdd)
             {
                 Monitor.Enter(m_collection);
             }
             aggregateObj = new Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj(aggregateDef, aggregateResult);
             m_collection.Add(name, aggregateObj);
             PopulateDuplicateNames(name, duplicateNames);
         }
         finally
         {
             if (m_lockAdd)
             {
                 Monitor.Exit(m_collection);
             }
         }
     }
     else
     {
         aggregateObj.Set(aggregateResult);
     }
 }
Esempio n. 4
0
 private void ProcessAggregateParam(Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo aggregate, ExpressionParser.ExpressionContext context)
 {
     if (aggregate != null && aggregate.Expressions != null)
     {
         for (int i = 0; i < aggregate.Expressions.Length; i++)
         {
             ProcessAggregateParam(aggregate.Expressions[i], context);
         }
     }
 }
Esempio n. 5
0
 internal ExpressionContext(ExpressionType expressionType, DataType constantType, Microsoft.ReportingServices.ReportPublishing.LocationFlags location, ObjectType objectType, string objectName, string propertyName, string dataSetName, int maxExpressionLength, PublishingContextBase publishingContext)
 {
     m_expressionType      = expressionType;
     m_constantType        = constantType;
     m_location            = location;
     m_objectType          = objectType;
     m_objectName          = objectName;
     m_propertyName        = propertyName;
     m_dataSetName         = dataSetName;
     m_inPrevious          = false;
     m_inLookup            = false;
     m_maxExpressionLength = maxExpressionLength;
     m_outerAggregate      = null;
     m_publishingContext   = publishingContext;
 }
 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;
 }
 private bool NeedsSubtotalScopeLift(Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo aggregate, IRIFDataScope displayScope)
 {
     if (aggregate.PublishingInfo.HasScope)
     {
         IRIFDataScope scopeByName = m_scopeTree.GetScopeByName(aggregate.PublishingInfo.Scope);
         if (scopeByName == null)
         {
             return(false);
         }
         if (m_scopeTree.IsParentScope(displayScope, scopeByName))
         {
             return(true);
         }
         return(false);
     }
     return(true);
 }
        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);
        }
Esempio n. 9
0
 internal override DataAggregate ConstructAggregator(OnDemandProcessingContext odpContext, DataAggregateInfo aggregateDef)
 {
     return(new CountRows());
 }
 internal DataAggregateObj(DataAggregateInfo aggrDef, DataAggregateObjResult aggrResult)
 {
     m_nonAggregateMode = true;
     m_aggregateDef     = aggrDef;
     m_aggregateResult  = aggrResult;
 }
 internal abstract DataAggregate ConstructAggregator(OnDemandProcessingContext odpContext, DataAggregateInfo aggregateDef);
        private void PageInit(ReportSection section)
        {
            ObjectModelImpl reportObjectModel = m_processingContext.ReportObjectModel;
            AggregatesImpl  aggregatesImpl    = reportObjectModel.AggregatesImpl;

            Global.Tracer.Assert(section.BodyItemsForHeadFoot != null, "Missing cached BodyItemsForHeadFoot collection");
            Global.Tracer.Assert(section.PageSectionItemsForHeadFoot != null, "Missing cached PageSectionItemsForHeadFoot collection");
            section.BodyItemsForHeadFoot.ResetAll(default(Microsoft.ReportingServices.RdlExpressions.VariantResult));
            section.PageSectionItemsForHeadFoot.ResetAll();
            reportObjectModel.GlobalsImpl.SetPageNumbers(m_currentPageNumber, m_totalPages, m_currentOverallPageNumber, m_overallTotalPages);
            reportObjectModel.GlobalsImpl.SetPageName(m_pageName);
            _ = m_romReport.ReportDef;
            Microsoft.ReportingServices.ReportIntermediateFormat.ReportSection sectionDef = section.SectionDef;
            Microsoft.ReportingServices.ReportIntermediateFormat.Page          page       = sectionDef.Page;
            section.PageAggregatesOverReportItems = new Dictionary <string, AggregatesImpl>();
            m_processingContext.ReportObjectModel.ReportItemsImpl.SpecialMode = true;
            if (page.PageAggregates != null)
            {
                for (int i = 0; i < page.PageAggregates.Count; i++)
                {
                    Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo dataAggregateInfo = page.PageAggregates[i];
                    aggregatesImpl.Remove(dataAggregateInfo);
                    dataAggregateInfo.ExprHostInitialized = false;
                    Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj dataAggregateObj = new Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj(dataAggregateInfo, m_processingContext);
                    dataAggregateObj.EvaluateParameters(out object[] _, out DataFieldStatus _);
                    string specialModeIndex = reportObjectModel.ReportItemsImpl.GetSpecialModeIndex();
                    if (specialModeIndex == null)
                    {
                        aggregatesImpl.Add(dataAggregateObj);
                    }
                    else
                    {
                        if (!section.PageAggregatesOverReportItems.TryGetValue(specialModeIndex, out AggregatesImpl value))
                        {
                            value = new AggregatesImpl(m_processingContext);
                            section.PageAggregatesOverReportItems.Add(specialModeIndex, value);
                        }
                        value.Add(dataAggregateObj);
                        m_reportItemToReportSection[specialModeIndex] = section;
                    }
                    dataAggregateObj.Init();
                }
            }
            reportObjectModel.ReportItemsImpl.SpecialMode = false;
            Microsoft.ReportingServices.ReportIntermediateFormat.PageSection rifObject = null;
            IReportScopeInstance romInstance = null;

            if (sectionDef.Page.PageHeader != null)
            {
                rifObject   = sectionDef.Page.PageHeader;
                romInstance = section.Page.PageHeader.Instance.ReportScopeInstance;
                section.Page.PageHeader.SetNewContext();
            }
            if (sectionDef.Page.PageFooter != null)
            {
                rifObject   = sectionDef.Page.PageFooter;
                romInstance = section.Page.PageFooter.Instance.ReportScopeInstance;
                section.Page.PageFooter.SetNewContext();
            }
            if (sectionDef != null)
            {
                m_processingContext.SetupContext(rifObject, romInstance);
            }
        }
 private DataAggregate GetPrototype(DataAggregateInfo aggregateDef)
 {
     return(m_prototypes[(int)aggregateDef.AggregateType]);
 }
 public object GetNoRowsResult(DataAggregateInfo aggregateDef)
 {
     return(GetPrototype(aggregateDef).Result());
 }
Esempio n. 15
0
 internal override DataAggregate ConstructAggregator(OnDemandProcessingContext odpContext, DataAggregateInfo aggregateDef)
 {
     return(new Max(odpContext.ProcessingComparer));
 }
 internal static void CreateAggregates(OnDemandProcessingContext odpContext, List <Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo> aggDefs, List <int> aggregateIndexes, ref List <Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj> nonCustomAggregates, ref List <Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj> customAggregates)
 {
     if (aggregateIndexes == null || 0 >= aggregateIndexes.Count)
     {
         return;
     }
     for (int i = 0; i < aggregateIndexes.Count; i++)
     {
         Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo dataAggregateInfo = aggDefs[aggregateIndexes[i]];
         Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj  aggregate         = new Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj(dataAggregateInfo, odpContext);
         if (Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo.AggregateTypes.Aggregate == dataAggregateInfo.AggregateType)
         {
             AddAggregate(ref customAggregates, aggregate);
         }
         else
         {
             AddAggregate(ref nonCustomAggregates, aggregate);
         }
     }
 }
Esempio n. 17
0
        internal override DataAggregate ConstructAggregator(OnDemandProcessingContext odpContext, DataAggregateInfo aggregateDef)
        {
            RunningValueInfo runningValueInfo = (RunningValueInfo)aggregateDef;

            return(new Previous(odpContext, runningValueInfo.TotalGroupingExpressionCount, runningValueInfo.IsScopedInEvaluationScope, string.IsNullOrEmpty(runningValueInfo.Scope)));
        }
 public DataAggregate CreateAggregator(OnDemandProcessingContext odpContext, DataAggregateInfo aggregateDef)
 {
     return(GetPrototype(aggregateDef).ConstructAggregator(odpContext, aggregateDef));
 }
Esempio n. 19
0
        private void CreateAggregates(List <Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo> aggDefs)
        {
            if (aggDefs == null || 0 >= aggDefs.Count)
            {
                return;
            }
            AggregatesImpl aggregatesImpl = m_odpContext.ReportObjectModel.AggregatesImpl;

            for (int i = 0; i < aggDefs.Count; i++)
            {
                Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo dataAggregateInfo = aggDefs[i];
                Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj  dataAggregateObj  = aggregatesImpl.GetAggregateObj(dataAggregateInfo.Name);
                if (dataAggregateObj == null)
                {
                    dataAggregateObj = new Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateObj(dataAggregateInfo, m_odpContext);
                    aggregatesImpl.Add(dataAggregateObj);
                }
                if (Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo.AggregateTypes.Previous != dataAggregateInfo.AggregateType)
                {
                    if (Microsoft.ReportingServices.ReportIntermediateFormat.DataAggregateInfo.AggregateTypes.Aggregate == dataAggregateInfo.AggregateType)
                    {
                        RuntimeDataRegionObj.AddAggregate(ref m_customAggregates, dataAggregateObj);
                    }
                    else
                    {
                        RuntimeDataRegionObj.AddAggregate(ref m_nonCustomAggregates, dataAggregateObj);
                    }
                }
            }
        }