internal CustomReportItemHeadingInstance(ReportProcessing.ProcessingContext pc, int headingCellIndex, CustomReportItemHeading headingDef, VariantList groupExpressionValues, int recursiveLevel)
 {
     if (headingDef.InnerHeadings != null)
     {
         m_subHeadingInstances = new CustomReportItemHeadingInstanceList();
     }
     m_headingDef       = headingDef;
     m_headingCellIndex = headingCellIndex;
     if (groupExpressionValues != null)
     {
         m_groupExpressionValues = new VariantList(groupExpressionValues.Count);
         for (int i = 0; i < groupExpressionValues.Count; i++)
         {
             if (groupExpressionValues[i] == null || DBNull.Value == groupExpressionValues[i])
             {
                 m_groupExpressionValues.Add(null);
             }
             else
             {
                 m_groupExpressionValues.Add(groupExpressionValues[i]);
             }
         }
     }
     if (headingDef.Grouping != null && headingDef.Grouping.GroupLabel != null)
     {
         m_label = pc.NavigationInfo.RegisterLabel(pc.ReportRuntime.EvaluateGroupingLabelExpression(headingDef.Grouping, headingDef.DataRegionDef.ObjectType, headingDef.DataRegionDef.Name));
     }
     if (headingDef.CustomProperties != null)
     {
         m_customPropertyInstances = headingDef.CustomProperties.EvaluateExpressions(headingDef.DataRegionDef.ObjectType, headingDef.DataRegionDef.Name, "DataGrouping.", pc);
     }
     m_recursiveLevel = recursiveLevel;
 }
Beispiel #2
0
        internal void Add(GroupingList scopeDefs, VariantList[] scopeValues, int value)
        {
            if (scopeValues == null || scopeValues.Length == 0)
            {
                Global.Tracer.Assert(scopeDefs == null || scopeDefs.Count == 0, "(null == scopeDefs || 0 == scopeDefs.Count)");
                m_lookupTable = value;
                return;
            }
            bool lookup = true;

            if (m_lookupTable == null)
            {
                m_lookupTable = new Hashtable();
                lookup        = false;
            }
            Hashtable hashEntries = (Hashtable)m_lookupTable;
            int       num         = 0;
            int       num2        = 0;

            for (int i = 0; i < scopeValues.Length; i++)
            {
                VariantList variantList = scopeValues[i];
                if (variantList == null)
                {
                    num2++;
                    continue;
                }
                num = variantList.Count;
                if (i == scopeValues.Length - 1)
                {
                    num--;
                }
                GetNullScopeEntries(num2, ref hashEntries, ref lookup);
                for (int j = 0; j < num; j++)
                {
                    Hashtable hashtable = (!lookup) ? null : ((Hashtable)hashEntries[variantList[j]]);
                    if (hashtable == null)
                    {
                        hashtable = new Hashtable();
                        hashEntries.Add(variantList[j], hashtable);
                        lookup = false;
                    }
                    hashEntries = hashtable;
                }
                num2 = 0;
            }
            object key = 1;

            if (scopeValues[scopeValues.Length - 1] != null)
            {
                key = scopeValues[scopeValues.Length - 1][num];
            }
            else
            {
                GetNullScopeEntries(num2, ref hashEntries, ref lookup);
            }
            Global.Tracer.Assert(!hashEntries.Contains(key), "(!hashEntries.Contains(lastKey))");
            hashEntries.Add(key, value);
        }
Beispiel #3
0
 internal OWCChartInstanceInfo(ReportProcessing.ProcessingContext pc, OWCChart reportItemDef, OWCChartInstance owner)
     : base(pc, reportItemDef, owner, addToChunk: false)
 {
     m_chartData = new VariantList[reportItemDef.ChartData.Count];
     for (int i = 0; i < reportItemDef.ChartData.Count; i++)
     {
         m_chartData[i] = new VariantList();
     }
     m_noRows = pc.ReportRuntime.EvaluateDataRegionNoRowsExpression(reportItemDef, reportItemDef.ObjectType, reportItemDef.Name, "NoRows");
 }
Beispiel #4
0
        internal void PopulateFieldPropertyValues(StringList propertyNames)
        {
            if (propertyNames == null)
            {
                return;
            }
            int count = propertyNames.Count;

            m_fieldPropertyValues = new VariantList(count);
            for (int i = 0; i < count; i++)
            {
                object value = null;
                if (m_properties != null)
                {
                    value = m_properties[propertyNames[i]];
                }
                m_fieldPropertyValues.Add(value);
            }
        }
Beispiel #5
0
        internal int Lookup(GroupingList scopeDefs, VariantList[] scopeValues)
        {
            object obj = null;

            if (scopeValues == null || scopeValues.Length == 0)
            {
                Global.Tracer.Assert(scopeDefs == null || scopeDefs.Count == 0, "(null == scopeDefs || 0 == scopeDefs.Count)");
                obj = m_lookupTable;
            }
            else
            {
                Hashtable hashtable = (Hashtable)m_lookupTable;
                int       num       = 0;
                for (int i = 0; i < scopeValues.Length; i++)
                {
                    VariantList variantList = scopeValues[i];
                    if (variantList == null)
                    {
                        num++;
                        continue;
                    }
                    hashtable = (Hashtable)hashtable[num];
                    for (int j = 0; j < variantList.Count; j++)
                    {
                        obj = hashtable[variantList[j]];
                        if (i < scopeValues.Length - 1 || j < variantList.Count - 1)
                        {
                            hashtable = (Hashtable)obj;
                            Global.Tracer.Assert(hashtable != null, "(null != hashEntries)");
                        }
                    }
                    num = 0;
                }
                if (scopeValues[scopeValues.Length - 1] == null)
                {
                    hashtable = (Hashtable)hashtable[num];
                    obj       = hashtable[1];
                }
            }
            Global.Tracer.Assert(obj is int);
            return((int)obj);
        }
        internal void RegisterSortFilterExpressionScope(ReportProcessing.IScope container, ReportProcessing.RuntimeDataRegionObj scopeObj, bool[] isSortFilterExpressionScope)
        {
            RuntimeSortFilterEventInfoList runtimeSortFilterInfo = m_runtimeSortFilterInfo;

            if (runtimeSortFilterInfo == null || isSortFilterExpressionScope == null || scopeObj == null)
            {
                return;
            }
            VariantList[] array = null;
            for (int i = 0; i < runtimeSortFilterInfo.Count; i++)
            {
                if (isSortFilterExpressionScope[i] && scopeObj.IsTargetForSort(i, detailSort: false) && scopeObj.TargetScopeMatched(i, detailSort: false))
                {
                    if (array == null && runtimeSortFilterInfo[i].EventSource.UserSort.GroupsInSortTarget != null)
                    {
                        int index = 0;
                        array = new VariantList[runtimeSortFilterInfo[i].EventSource.UserSort.GroupsInSortTarget.Count];
                        scopeObj.GetScopeValues(runtimeSortFilterInfo[i].EventTarget, array, ref index);
                    }
                    runtimeSortFilterInfo[i].RegisterSortFilterExpressionScope(ref container.SortFilterExpressionScopeInfoIndices[i], scopeObj, array, i);
                }
            }
        }
 internal ChartHeadingInstance(ReportProcessing.ProcessingContext pc, int headingCellIndex, ChartHeading chartHeadingDef, int labelIndex, VariantList groupExpressionValues)
 {
     m_uniqueName = pc.CreateUniqueName();
     if (chartHeadingDef.SubHeading != null)
     {
         m_subHeadingInstances = new ChartHeadingInstanceList();
     }
     m_instanceInfo    = new ChartHeadingInstanceInfo(pc, headingCellIndex, chartHeadingDef, labelIndex, groupExpressionValues);
     m_chartHeadingDef = chartHeadingDef;
 }
 internal MatrixSubtotalHeadingInstanceInfo(ReportProcessing.ProcessingContext pc, int headingCellIndex, MatrixHeading matrixHeadingDef, MatrixHeadingInstance owner, bool isSubtotal, int reportItemDefIndex, VariantList groupExpressionValues, out NonComputedUniqueNames nonComputedUniqueNames)
     : base(pc, headingCellIndex, matrixHeadingDef, owner, isSubtotal, reportItemDefIndex, groupExpressionValues, out nonComputedUniqueNames)
 {
     Global.Tracer.Assert(isSubtotal);
     Global.Tracer.Assert(matrixHeadingDef.Subtotal != null);
     Global.Tracer.Assert(matrixHeadingDef.Subtotal.StyleClass != null);
     if (matrixHeadingDef.Subtotal.StyleClass.ExpressionList != null)
     {
         m_styleAttributeValues = new object[matrixHeadingDef.Subtotal.StyleClass.ExpressionList.Count];
         ReportProcessing.RuntimeRICollection.EvaluateStyleAttributes(ObjectType.Subtotal, matrixHeadingDef.Grouping.Name, matrixHeadingDef.Subtotal.StyleClass, owner.UniqueName, m_styleAttributeValues, pc);
     }
 }
 internal bool PopulateRuntimeSortFilterEventInfo(ReportProcessing.ProcessingContext pc, DataSet myDataSet)
 {
     if (pc.UserSortFilterInfo == null || pc.UserSortFilterInfo.SortInfo == null || pc.OldSortFilterEventInfo == null)
     {
         return(false);
     }
     if (m_dataSetID != -1)
     {
         return(false);
     }
     m_runtimeSortFilterInfo = null;
     EventInformation.SortEventInfo sortInfo = pc.UserSortFilterInfo.SortInfo;
     for (int i = 0; i < sortInfo.Count; i++)
     {
         int uniqueNameAt = sortInfo.GetUniqueNameAt(i);
         SortFilterEventInfo sortFilterEventInfo = pc.OldSortFilterEventInfo[uniqueNameAt];
         if (sortFilterEventInfo != null && sortFilterEventInfo.EventSource.UserSort != null && sortFilterEventInfo.EventSource.UserSort.DataSetID == myDataSet.ID)
         {
             if (m_runtimeSortFilterInfo == null)
             {
                 m_runtimeSortFilterInfo = new RuntimeSortFilterEventInfoList();
             }
             m_runtimeSortFilterInfo.Add(new RuntimeSortFilterEventInfo(sortFilterEventInfo.EventSource, uniqueNameAt, sortInfo.GetSortDirectionAt(i), sortFilterEventInfo.EventSourceScopeInfo));
         }
     }
     if (m_runtimeSortFilterInfo != null)
     {
         int count = m_runtimeSortFilterInfo.Count;
         for (int j = 0; j < count; j++)
         {
             TextBox          eventSource         = m_runtimeSortFilterInfo[j].EventSource;
             ISortFilterScope sortExpressionScope = eventSource.UserSort.SortExpressionScope;
             if (sortExpressionScope != null)
             {
                 sortExpressionScope.IsSortFilterExpressionScope = SetSortFilterInfo(sortExpressionScope.IsSortFilterExpressionScope, count, j);
             }
             ISortFilterScope sortTarget = eventSource.UserSort.SortTarget;
             if (sortTarget != null)
             {
                 sortTarget.IsSortFilterTarget = SetSortFilterInfo(sortTarget.IsSortFilterTarget, count, j);
             }
             if (eventSource.ContainingScopes != null && 0 < eventSource.ContainingScopes.Count)
             {
                 int num = 0;
                 for (int k = 0; k < eventSource.ContainingScopes.Count; k++)
                 {
                     Grouping    grouping    = eventSource.ContainingScopes[k];
                     VariantList variantList = m_runtimeSortFilterInfo[j].SortSourceScopeInfo[k];
                     if (grouping != null)
                     {
                         if (grouping.SortFilterScopeInfo == null)
                         {
                             grouping.SortFilterScopeInfo = new VariantList[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]  = variantList;
                         grouping.SortFilterScopeIndex[j] = k;
                         continue;
                     }
                     SubReportList detailScopeSubReports = eventSource.UserSort.DetailScopeSubReports;
                     ReportItem    parent;
                     if (detailScopeSubReports != null && num < detailScopeSubReports.Count)
                     {
                         parent = detailScopeSubReports[num++].Parent;
                     }
                     else
                     {
                         Global.Tracer.Assert(k == eventSource.ContainingScopes.Count - 1, "(j == eventSource.ContainingScopes.Count - 1)");
                         parent = eventSource.Parent;
                     }
                     while (parent != null && !(parent is DataRegion))
                     {
                         parent = parent.Parent;
                     }
                     Global.Tracer.Assert(parent is DataRegion, "(parent is DataRegion)");
                     DataRegion dataRegion = (DataRegion)parent;
                     if (dataRegion.SortFilterSourceDetailScopeInfo == null)
                     {
                         dataRegion.SortFilterSourceDetailScopeInfo = new int[count];
                         for (int n = 0; n < count; n++)
                         {
                             dataRegion.SortFilterSourceDetailScopeInfo[n] = -1;
                         }
                     }
                     Global.Tracer.Assert(variantList != null && 1 == variantList.Count, "(null != scopeValues && 1 == scopeValues.Count)");
                     dataRegion.SortFilterSourceDetailScopeInfo[j] = (int)variantList[0];
                 }
             }
             GroupingList groupsInSortTarget = eventSource.UserSort.GroupsInSortTarget;
             if (groupsInSortTarget != null)
             {
                 for (int num2 = 0; num2 < groupsInSortTarget.Count; num2++)
                 {
                     groupsInSortTarget[num2].NeedScopeInfoForSortFilterExpression = SetSortFilterInfo(groupsInSortTarget[num2].NeedScopeInfoForSortFilterExpression, count, j);
                 }
             }
             IntList peerSortFilters = eventSource.GetPeerSortFilters(create: false);
             if (peerSortFilters == null)
             {
                 continue;
             }
             if (m_runtimeSortFilterInfo[j].PeerSortFilters == null)
             {
                 m_runtimeSortFilterInfo[j].PeerSortFilters = new Hashtable();
             }
             for (int num3 = 0; num3 < peerSortFilters.Count; num3++)
             {
                 if (eventSource.ID != peerSortFilters[num3])
                 {
                     m_runtimeSortFilterInfo[j].PeerSortFilters.Add(peerSortFilters[num3], null);
                 }
             }
         }
     }
     return(true);
 }
        internal MatrixHeadingInstanceInfo(ReportProcessing.ProcessingContext pc, int headingCellIndex, MatrixHeading matrixHeadingDef, MatrixHeadingInstance owner, bool isSubtotal, int reportItemDefIndex, VariantList groupExpressionValues, out NonComputedUniqueNames nonComputedUniqueNames)
        {
            ReportItemCollection reportItems;

            if (isSubtotal)
            {
                reportItems = matrixHeadingDef.Subtotal.ReportItems;
            }
            else
            {
                reportItems = matrixHeadingDef.ReportItems;
                if (matrixHeadingDef.OwcGroupExpression)
                {
                    if (groupExpressionValues == null || DBNull.Value == groupExpressionValues[0])
                    {
                        m_groupExpressionValue = null;
                    }
                    else
                    {
                        m_groupExpressionValue = groupExpressionValues[0];
                    }
                }
            }
            if (0 < reportItems.Count && !reportItems.IsReportItemComputed(reportItemDefIndex))
            {
                m_contentUniqueNames = NonComputedUniqueNames.CreateNonComputedUniqueNames(pc, reportItems[reportItemDefIndex]);
            }
            nonComputedUniqueNames = m_contentUniqueNames;
            m_headingCellIndex     = headingCellIndex;
            if (!isSubtotal && pc.ShowHideType != 0)
            {
                m_startHidden = pc.ProcessReceiver(owner.UniqueName, matrixHeadingDef.Visibility, matrixHeadingDef.ExprHost, matrixHeadingDef.DataRegionDef.ObjectType, matrixHeadingDef.DataRegionDef.Name);
            }
            if (matrixHeadingDef.Grouping != null && matrixHeadingDef.Grouping.GroupLabel != null)
            {
                m_label = pc.NavigationInfo.RegisterLabel(pc.ReportRuntime.EvaluateGroupingLabelExpression(matrixHeadingDef.Grouping, matrixHeadingDef.DataRegionDef.ObjectType, matrixHeadingDef.DataRegionDef.Name));
            }
            if (matrixHeadingDef.Grouping != null && matrixHeadingDef.Grouping.CustomProperties != null)
            {
                m_customPropertyInstances = matrixHeadingDef.Grouping.CustomProperties.EvaluateExpressions(matrixHeadingDef.DataRegionDef.ObjectType, matrixHeadingDef.DataRegionDef.Name, matrixHeadingDef.Grouping.Name + ".", pc);
            }
            matrixHeadingDef.StartHidden = m_startHidden;
        }
Beispiel #11
0
 internal ChartHeadingInstanceInfo(ReportProcessing.ProcessingContext pc, int headingCellIndex, ChartHeading chartHeadingDef, int labelIndex, VariantList groupExpressionValues)
 {
     m_headingCellIndex = headingCellIndex;
     if (chartHeadingDef.ChartGroupExpression)
     {
         if (groupExpressionValues == null || DBNull.Value == groupExpressionValues[0])
         {
             m_groupExpressionValue = null;
         }
         else
         {
             m_groupExpressionValue = groupExpressionValues[0];
         }
     }
     if (chartHeadingDef.Labels != null)
     {
         ExpressionInfo expressionInfo = chartHeadingDef.Labels[labelIndex];
         if (expressionInfo != null)
         {
             if (chartHeadingDef.Grouping != null)
             {
                 m_headingLabel = pc.ReportRuntime.EvaluateChartDynamicHeadingLabelExpression(chartHeadingDef, expressionInfo, chartHeadingDef.DataRegionDef.Name);
             }
             else
             {
                 m_headingLabel = pc.ReportRuntime.EvaluateChartStaticHeadingLabelExpression(chartHeadingDef, expressionInfo, chartHeadingDef.DataRegionDef.Name);
             }
         }
     }
     if (chartHeadingDef.Grouping == null)
     {
         m_staticGroupingIndex = labelIndex;
     }
     else if (chartHeadingDef.Grouping.CustomProperties != null)
     {
         m_customPropertyInstances = chartHeadingDef.Grouping.CustomProperties.EvaluateExpressions(chartHeadingDef.DataRegionDef.ObjectType, chartHeadingDef.DataRegionDef.Name, chartHeadingDef.Grouping.Name + ".", pc);
     }
 }
Beispiel #12
0
 internal MatrixHeadingInstance(ReportProcessing.ProcessingContext pc, int headingCellIndex, MatrixHeading matrixHeadingDef, bool isSubtotal, int reportItemDefIndex, VariantList groupExpressionValues, out NonComputedUniqueNames nonComputedUniqueNames)
 {
     m_uniqueName = pc.CreateUniqueName();
     if (isSubtotal && matrixHeadingDef.Subtotal.StyleClass != null)
     {
         m_instanceInfo = new MatrixSubtotalHeadingInstanceInfo(pc, headingCellIndex, matrixHeadingDef, this, isSubtotal, reportItemDefIndex, groupExpressionValues, out nonComputedUniqueNames);
         if (matrixHeadingDef.GetInnerStaticHeading() != null)
         {
             m_subHeadingInstances = new MatrixHeadingInstanceList();
         }
     }
     else
     {
         m_instanceInfo = new MatrixHeadingInstanceInfo(pc, headingCellIndex, matrixHeadingDef, this, isSubtotal, reportItemDefIndex, groupExpressionValues, out nonComputedUniqueNames);
         if (matrixHeadingDef.SubHeading != null)
         {
             m_subHeadingInstances = new MatrixHeadingInstanceList();
         }
     }
     m_renderingPages   = new RenderingPagesRangesList();
     m_matrixHeadingDef = matrixHeadingDef;
     m_isSubtotal       = isSubtotal;
     m_headingDefIndex  = reportItemDefIndex;
     if (!matrixHeadingDef.IsColumn)
     {
         pc.Pagination.EnterIgnoreHeight(matrixHeadingDef.StartHidden);
     }
     if (matrixHeadingDef.FirstHeadingInstances == null)
     {
         int count = matrixHeadingDef.ReportItems.Count;
         matrixHeadingDef.FirstHeadingInstances = new BoolList(count);
         for (int i = 0; i < count; i++)
         {
             matrixHeadingDef.FirstHeadingInstances.Add(true);
         }
     }
 }