Пример #1
0
            private void CalculateRows(MatrixHeading row, double height)
            {
                if (row == null)
                {
                    return;
                }
                double num = height;

                if (row.Grouping == null)
                {
                    if (row.ReportItems != null)
                    {
                        for (int i = 0; i < row.ReportItems.Count; i++)
                        {
                            CalculateSize(row.ReportItems[i], row.SizeValue, m_rows[i].HeightValue);
                            if (m_rows[i].HeightValue < num)
                            {
                                num = m_rows[i].HeightValue;
                            }
                        }
                    }
                }
                else
                {
                    if (row.Subtotal != null)
                    {
                        CalculateSize(row.Subtotal.ReportItem, row.SizeValue, height);
                    }
                    CalculateSize(row.ReportItem, row.SizeValue, height);
                }
                CalculateRows(row.SubHeading, num);
            }
Пример #2
0
            internal static void Calculate(Matrix matrix)
            {
                Global.Tracer.Assert(matrix != null);
                OWCFlagsCalculator oWCFlagsCalculator = new OWCFlagsCalculator();

                oWCFlagsCalculator.CalculateOWCFlags(matrix);
                if (!oWCFlagsCalculator.m_useOWC)
                {
                    return;
                }
                matrix.UseOWC       = oWCFlagsCalculator.m_useOWC;
                matrix.OwcCellNames = oWCFlagsCalculator.m_owcCellNames;
                int num = 0;

                for (MatrixHeading matrixHeading = matrix.Rows; matrixHeading != null; matrixHeading = matrixHeading.SubHeading)
                {
                    if (matrixHeading.Grouping != null)
                    {
                        matrixHeading.OwcGroupExpression = oWCFlagsCalculator.m_owcGroupExpression[num];
                        num++;
                    }
                }
                for (MatrixHeading matrixHeading2 = matrix.Columns; matrixHeading2 != null; matrixHeading2 = matrixHeading2.SubHeading)
                {
                    if (matrixHeading2.Grouping != null)
                    {
                        matrixHeading2.OwcGroupExpression = oWCFlagsCalculator.m_owcGroupExpression[num];
                        num++;
                    }
                }
            }
Пример #3
0
            private void CalculateColumns(MatrixHeading column, double width)
            {
                if (column == null)
                {
                    return;
                }
                double num = width;

                if (column.Grouping == null)
                {
                    if (column.ReportItems != null)
                    {
                        for (int i = 0; i < column.ReportItems.Count; i++)
                        {
                            CalculateSize(column.ReportItems[i], m_columns[i].WidthValue, column.SizeValue);
                            if (m_columns[i].WidthValue < num)
                            {
                                num = m_columns[i].WidthValue;
                            }
                        }
                    }
                }
                else
                {
                    if (column.Subtotal != null)
                    {
                        CalculateSize(column.Subtotal.ReportItem, width, column.SizeValue);
                    }
                    CalculateSize(column.ReportItem, width, column.SizeValue);
                }
                CalculateColumns(column.SubHeading, num);
            }
Пример #4
0
 internal void Add(MatrixHeadingInstance matrixHeadingInstance, ReportProcessing.ProcessingContext pc)
 {
     if (m_lastHeadingInstance != null)
     {
         m_lastHeadingInstance.InstanceInfo.HeadingSpan = matrixHeadingInstance.InstanceInfo.HeadingCellIndex - m_lastHeadingInstance.InstanceInfo.HeadingCellIndex;
         bool          flag             = true;
         MatrixHeading matrixHeadingDef = m_lastHeadingInstance.MatrixHeadingDef;
         if (pc.ReportItemsReferenced)
         {
             Matrix matrix = (Matrix)matrixHeadingDef.DataRegionDef;
             if (matrixHeadingDef.IsColumn)
             {
                 if (matrix.ProcessingInnerGrouping == Pivot.ProcessingInnerGroupings.Column)
                 {
                     flag = false;
                 }
             }
             else if (matrix.ProcessingInnerGrouping == Pivot.ProcessingInnerGroupings.Row)
             {
                 flag = false;
             }
         }
         if (flag)
         {
             bool flag2;
             if (m_lastHeadingInstance.IsSubtotal)
             {
                 flag2 = m_lastHeadingInstance.MatrixHeadingDef.Subtotal.FirstInstance;
                 m_lastHeadingInstance.MatrixHeadingDef.Subtotal.FirstInstance = false;
             }
             else
             {
                 BoolList firstHeadingInstances = m_lastHeadingInstance.MatrixHeadingDef.FirstHeadingInstances;
                 flag2 = firstHeadingInstances[m_lastHeadingInstance.HeadingIndex];
                 firstHeadingInstances[m_lastHeadingInstance.HeadingIndex] = false;
             }
             pc.ChunkManager.AddInstance(m_lastHeadingInstance.InstanceInfo, m_lastHeadingInstance, flag2 || matrixHeadingDef.InFirstPage, pc.InPageSection);
         }
     }
     base.Add(matrixHeadingInstance);
     m_lastHeadingInstance = matrixHeadingInstance;
     matrixHeadingInstance.MatrixHeadingDef.InFirstPage = pc.ChunkManager.InFirstPage;
 }
Пример #5
0
        private GroupingList GenerateUserSortGroupingList(bool rowIsInnerGrouping)
        {
            GroupingList groupingList = new GroupingList();

            for (MatrixHeading matrixHeading = rowIsInnerGrouping ? m_rows : m_columns; matrixHeading != null; matrixHeading = matrixHeading.SubHeading)
            {
                if (matrixHeading.Grouping != null)
                {
                    groupingList.Add(matrixHeading.Grouping);
                }
            }
            for (MatrixHeading matrixHeading = rowIsInnerGrouping ? m_columns : m_rows; matrixHeading != null; matrixHeading = matrixHeading.SubHeading)
            {
                if (matrixHeading.Grouping != null)
                {
                    groupingList.Add(matrixHeading.Grouping);
                }
            }
            return(groupingList);
        }
Пример #6
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);
         }
     }
 }
Пример #7
0
        internal void CalculatePropagatedFlags()
        {
            MatrixHeading matrixHeading = m_rows;
            int           num           = 0;

            do
            {
                if (matrixHeading.Grouping != null)
                {
                    if (matrixHeading.Grouping.PageBreakAtStart)
                    {
                        m_propagatedPageBreakAtStart = true;
                        m_innerRowLevelWithPageBreak = num;
                    }
                    if (matrixHeading.Grouping.PageBreakAtEnd)
                    {
                        m_propagatedPageBreakAtEnd   = true;
                        m_innerRowLevelWithPageBreak = num;
                    }
                }
                matrixHeading = matrixHeading.SubHeading;
                num++;
            }while (matrixHeading != null);
        }
Пример #8
0
 private void CalculateOWCFlags(MatrixHeading heading)
 {
     if (heading == null)
     {
         return;
     }
     if (heading.Grouping == null)
     {
         m_staticHeadingCount++;
         if (m_staticHeadingCount > 1)
         {
             m_useOWC = false;
             return;
         }
         if (heading.SubHeading != null)
         {
             m_useOWC = false;
             return;
         }
         if (heading.ReportItems != null)
         {
             for (int i = 0; i < heading.ReportItems.Count; i++)
             {
                 DetectIllegalReportItems(heading.ReportItems[i]);
                 if (IsFinish())
                 {
                     return;
                 }
                 TextBox textBox = FindNotAlwaysHiddenTextBox(heading.ReportItems[i]);
                 if (IsFinish())
                 {
                     return;
                 }
                 if (textBox == null)
                 {
                     m_useOWC = false;
                     return;
                 }
             }
         }
     }
     else
     {
         ExpressionInfo expressionInfo = null;
         if (heading.Grouping.GroupExpressions != null)
         {
             if (heading.Grouping.GroupExpressions.Count != 1)
             {
                 m_useOWC = false;
                 return;
             }
             expressionInfo = heading.Grouping.GroupExpressions[0];
         }
         DetectIllegalReportItems(heading.ReportItem);
         if (IsFinish())
         {
             return;
         }
         TextBox textBox2 = FindNotAlwaysHiddenTextBox(heading.ReportItem);
         if (IsFinish())
         {
             return;
         }
         if (textBox2 == null)
         {
             m_useOWC = false;
             return;
         }
         Global.Tracer.Assert(expressionInfo != null);
         Global.Tracer.Assert(textBox2.Value != null);
         if (expressionInfo.OriginalText != textBox2.Value.OriginalText)
         {
             m_owcGroupExpression.Add(true);
         }
         else
         {
             m_owcGroupExpression.Add(false);
         }
     }
     CalculateOWCFlags(heading.SubHeading);
 }
Пример #9
0
        private void MatrixCellInitialize(InitializationContext context, int expectedNumberOfMatrixColumns, int expectedNumberOfMatrixRows, bool computedSubtotal, out double totalCellHeight, out double totalCellWidth)
        {
            if (expectedNumberOfMatrixColumns != m_matrixColumns.Count)
            {
                context.ErrorContext.Register(ProcessingErrorCode.rsWrongNumberOfMatrixColumns, Severity.Error, context.ObjectType, context.ObjectName, "MatrixColumns");
            }
            if (expectedNumberOfMatrixRows != m_matrixRows.Count)
            {
                context.ErrorContext.Register(ProcessingErrorCode.rsWrongNumberOfMatrixRows, Severity.Error, context.ObjectType, context.ObjectName, "MatrixRows");
            }
            for (int i = 0; i < m_matrixRows.Count; i++)
            {
                if (expectedNumberOfMatrixColumns != m_matrixRows[i].NumberOfMatrixCells)
                {
                    context.ErrorContext.Register(ProcessingErrorCode.rsWrongNumberOfMatrixCells, Severity.Error, context.ObjectType, context.ObjectName, "MatrixCells");
                }
            }
            totalCellHeight = 0.0;
            totalCellWidth  = 0.0;
            for (int j = 0; j < m_matrixColumns.Count; j++)
            {
                m_matrixColumns[j].Initialize(context);
                totalCellWidth = Math.Round(totalCellWidth + m_matrixColumns[j].WidthValue, Validator.DecimalPrecision);
            }
            for (int k = 0; k < m_matrixRows.Count; k++)
            {
                m_matrixRows[k].Initialize(context);
                totalCellHeight = Math.Round(totalCellHeight + m_matrixRows[k].HeightValue, Validator.DecimalPrecision);
            }
            context.Location   = (context.Location | LocationFlags.InMatrixCell | LocationFlags.InMatrixCellTopLevelItem);
            context.MatrixName = m_name;
            context.RegisterTablixCellScope(m_columns.SubHeading == null && m_columns.Grouping == null, m_cellAggregates, m_cellPostSortAggregates);
            for (MatrixHeading matrixHeading = m_rows; matrixHeading != null; matrixHeading = matrixHeading.SubHeading)
            {
                context.RegisterReportItems(matrixHeading.ReportItems);
                if (matrixHeading.Grouping != null)
                {
                    context.Location |= LocationFlags.InGrouping;
                    context.RegisterGroupingScopeForTablixCell(matrixHeading.Grouping.Name, column: false, matrixHeading.Grouping.SimpleGroupExpressions, matrixHeading.Aggregates, matrixHeading.PostSortAggregates, matrixHeading.RecursiveAggregates, matrixHeading.Grouping);
                }
            }
            if (m_rows.Grouping != null && m_rows.Subtotal != null && m_staticRows != null)
            {
                context.CopyRunningValues(StaticRows.ReportItems.RunningValues, m_aggregates);
            }
            for (MatrixHeading matrixHeading = m_columns; matrixHeading != null; matrixHeading = matrixHeading.SubHeading)
            {
                context.RegisterReportItems(matrixHeading.ReportItems);
                if (matrixHeading.Grouping != null)
                {
                    context.Location |= LocationFlags.InGrouping;
                    context.RegisterGroupingScopeForTablixCell(matrixHeading.Grouping.Name, column: true, matrixHeading.Grouping.SimpleGroupExpressions, matrixHeading.Aggregates, matrixHeading.PostSortAggregates, matrixHeading.RecursiveAggregates, matrixHeading.Grouping);
                }
            }
            if (m_columns.Grouping != null && m_columns.Subtotal != null && m_staticColumns != null)
            {
                context.CopyRunningValues(StaticColumns.ReportItems.RunningValues, m_aggregates);
            }
            if (computedSubtotal)
            {
                m_cellReportItems.MarkChildrenComputed();
            }
            context.RegisterReportItems(m_cellReportItems);
            OWCFlagsCalculator.Calculate(this);
            bool registerHiddenReceiver = context.RegisterHiddenReceiver;

            context.RegisterHiddenReceiver = false;
            context.RegisterScopeInMatrixCell(base.Name, "0_CellScope" + base.Name, registerMatrixCellScope: true);
            m_cellReportItems.Initialize(context, registerRunningValues: true);
            if (context.IsRunningValueDirectionColumn())
            {
                m_processingInnerGrouping = ProcessingInnerGroupings.Row;
            }
            context.UpdateScopesInMatrixCells(base.Name, GenerateUserSortGroupingList(ProcessingInnerGroupings.Row == m_processingInnerGrouping));
            context.TextboxesWithDetailSortExpressionInitialize();
            context.RegisterHiddenReceiver = registerHiddenReceiver;
            for (MatrixHeading matrixHeading = m_rows; matrixHeading != null; matrixHeading = matrixHeading.SubHeading)
            {
                context.UnRegisterReportItems(matrixHeading.ReportItems);
                if (matrixHeading.Grouping != null)
                {
                    context.UnRegisterGroupingScopeForTablixCell(matrixHeading.Grouping.Name, column: false);
                    context.ProcessUserSortInnerScope(matrixHeading.Grouping.Name, isMatrixGroup: true, isMatrixColumnGroup: false);
                }
            }
            for (MatrixHeading matrixHeading = m_rows; matrixHeading != null; matrixHeading = matrixHeading.SubHeading)
            {
                if (matrixHeading.Grouping != null)
                {
                    context.ValidateUserSortInnerScope(matrixHeading.Grouping.Name);
                }
            }
            for (MatrixHeading matrixHeading = m_columns; matrixHeading != null; matrixHeading = matrixHeading.SubHeading)
            {
                context.UnRegisterReportItems(matrixHeading.ReportItems);
                if (matrixHeading.Grouping != null)
                {
                    context.UnRegisterGroupingScopeForTablixCell(matrixHeading.Grouping.Name, column: true);
                    context.ProcessUserSortInnerScope(matrixHeading.Grouping.Name, isMatrixGroup: true, isMatrixColumnGroup: true);
                }
            }
            for (MatrixHeading matrixHeading = m_columns; matrixHeading != null; matrixHeading = matrixHeading.SubHeading)
            {
                if (matrixHeading.Grouping != null)
                {
                    context.ValidateUserSortInnerScope(matrixHeading.Grouping.Name);
                }
            }
            m_cellReportItems.RegisterReceiver(context);
            context.UnRegisterReportItems(m_cellReportItems);
            context.UnRegisterTablixCellScope();
        }
 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 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;
        }