コード例 #1
0
 public static void CalculateColumnZIndexes(RPLTablix tablix, RPLTablixRow row, int currentRow, int[] columnZIndexes)
 {
     if (currentRow < tablix.ColumnHeaderRows)
     {
         for (int i = 0; i < row.NumCells; i++)
         {
             RPLTablixMemberCell rPLTablixMemberCell = row[i] as RPLTablixMemberCell;
             if (rPLTablixMemberCell != null)
             {
                 columnZIndexes[rPLTablixMemberCell.ColIndex] = Math.Min(columnZIndexes[rPLTablixMemberCell.ColIndex], SharedRenderer.CalculateZIndex(rPLTablixMemberCell));
             }
         }
     }
     else
     {
         for (int j = 0; j < row.NumCells; j++)
         {
             RPLTablixMemberCell rPLTablixMemberCell2 = row[j] as RPLTablixMemberCell;
             if (rPLTablixMemberCell2 != null)
             {
                 columnZIndexes[rPLTablixMemberCell2.ColIndex] = SharedRenderer.CalculateZIndex(rPLTablixMemberCell2);
             }
         }
     }
 }
コード例 #2
0
        protected override void RenderTablixCell(RPLTablix tablix, float left, float[] widths, TablixGhostCell[] ghostCells, BorderContext borderContext, int nextCell, RPLTablixCell cell, List <RPLTablixMemberCell> .Enumerator omittedCells, bool lastCell)
        {
            RPLItemMeasurement tablixCellMeasurement = GetTablixCellMeasurement(cell, nextCell, widths, ghostCells, omittedCells, lastCell, tablix);

            RenderTablixCellItem(cell, widths, tablixCellMeasurement, left, borderContext);
            ClearTablixCellBorders(cell);
            FinishRenderingTablixCell(cell, widths, ghostCells, borderContext);
        }
コード例 #3
0
        internal override void ProcessRenderingElementContent(RPLElement rplElement, GdiContext context, RectangleF bounds)
        {
            RPLTablix       rPLTablix        = (RPLTablix)rplElement;
            FixedHeaderItem fixedHeaderItem  = null;
            FixedHeaderItem fixedHeaderItem2 = null;
            FixedHeaderItem fixedHeaderItem3 = null;
            float           num  = 0f;
            float           num2 = bounds.Top;

            float[] array = null;
            array = ((rPLTablix.ColumnWidths == null) ? new float[0] : new float[rPLTablix.ColumnWidths.Length]);
            int[] array2 = new int[array.Length];
            for (int i = 0; i < array2.Length; i++)
            {
                array2[i] = int.MaxValue;
            }
            for (int j = 0; j < array.Length; j++)
            {
                if (j > 0)
                {
                    array[j] = array[j - 1] + rPLTablix.ColumnWidths[j - 1];
                }
                if (rPLTablix.FixedColumns[j])
                {
                    if (fixedHeaderItem3 == null)
                    {
                        fixedHeaderItem3              = new FixedHeaderItem(this, base.Position, FixedHeaderItem.LayoutType.Vertical);
                        fixedHeaderItem3.Bounds.X    += array[j];
                        fixedHeaderItem3.Bounds.Width = rPLTablix.ColumnWidths[j];
                    }
                    else
                    {
                        fixedHeaderItem3.Bounds.X      = Math.Min(fixedHeaderItem3.Bounds.X, base.Position.X + array[j]);
                        fixedHeaderItem3.Bounds.Width += rPLTablix.ColumnWidths[j];
                    }
                }
            }
            if (rPLTablix.FixedRow(0))
            {
                fixedHeaderItem = new FixedHeaderItem(this, base.Position, FixedHeaderItem.LayoutType.Horizontal);
                fixedHeaderItem.Bounds.Height = 0f;
                context.RenderingReport.FixedHeaders.Add(fixedHeaderItem);
            }
            if (fixedHeaderItem3 != null)
            {
                context.RenderingReport.FixedHeaders.Add(fixedHeaderItem3);
                if (rPLTablix.FixedRow(0))
                {
                    fixedHeaderItem2 = new FixedHeaderItem(this, base.Position, FixedHeaderItem.LayoutType.Corner);
                    context.RenderingReport.FixedHeaders.Add(fixedHeaderItem2);
                }
            }
            int          num3 = 0;
            int          num4 = -1;
            RPLTablixRow nextRow;

            while ((nextRow = rPLTablix.GetNextRow()) != null)
            {
                if (nextRow is RPLTablixOmittedRow)
                {
                    continue;
                }
                SharedRenderer.CalculateColumnZIndexes(rPLTablix, nextRow, num3, array2);
                if (nextRow.OmittedHeaders != null)
                {
                    for (int k = 0; k < nextRow.OmittedHeaders.Count; k++)
                    {
                        RPLTablixMemberCell rPLTablixMemberCell = nextRow.OmittedHeaders[k];
                        if (!string.IsNullOrEmpty(rPLTablixMemberCell.GroupLabel))
                        {
                            float x = bounds.X;
                            if (rPLTablixMemberCell.ColIndex < array.Length)
                            {
                                x = array[rPLTablixMemberCell.ColIndex];
                            }
                            context.RenderingReport.Labels.Add(rPLTablixMemberCell.UniqueName, new LabelPoint(x, num2));
                        }
                    }
                }
                int num5 = int.MaxValue;
                for (int l = 0; l < nextRow.NumCells; l++)
                {
                    RPLTablixCell      rPLTablixCell      = nextRow[l];
                    RPLItemMeasurement rPLItemMeasurement = new RPLItemMeasurement();
                    rPLItemMeasurement.Element = rPLTablixCell.Element;
                    rPLItemMeasurement.Left    = array[rPLTablixCell.ColIndex];
                    rPLItemMeasurement.Top     = num;
                    rPLItemMeasurement.Width   = rPLTablix.GetColumnWidth(rPLTablixCell.ColIndex, rPLTablixCell.ColSpan);
                    rPLItemMeasurement.Height  = rPLTablix.GetRowHeight(rPLTablixCell.RowIndex, rPLTablixCell.RowSpan);
                    RenderingItem renderingItem = RenderingItem.CreateRenderingItem(context, rPLItemMeasurement, bounds);
                    if (renderingItem == null)
                    {
                        continue;
                    }
                    if (renderingItem is RenderingDynamicImage)
                    {
                        ((RenderingDynamicImage)renderingItem).Sizing = RPLFormat.Sizings.Fit;
                    }
                    RPLTablixMemberCell rPLTablixMemberCell2 = rPLTablixCell as RPLTablixMemberCell;
                    if (rPLTablixMemberCell2 != null && !string.IsNullOrEmpty(rPLTablixMemberCell2.GroupLabel))
                    {
                        context.RenderingReport.Labels.Add(rPLTablixMemberCell2.UniqueName, new LabelPoint(rPLItemMeasurement.Left, rPLItemMeasurement.Top));
                    }
                    if (renderingItem.HasBorders)
                    {
                        renderingItem.DelayDrawBorders = true;
                        if (num3 < rPLTablix.ColumnHeaderRows && rPLTablixCell is RPLTablixCornerCell)
                        {
                            m_cornerBorders.Add(new RenderingItemBorderTablix(0, 0, rPLTablixCell.RowIndex, rPLTablixCell.ColIndex, renderingItem));
                        }
                        else
                        {
                            if (num5 == int.MaxValue)
                            {
                                num5 = SharedRenderer.CalculateRowZIndex(nextRow);
                            }
                            if (num5 == int.MaxValue)
                            {
                                num5 = num4;
                            }
                            RenderingItemBorderTablix renderingItemBorderTablix = new RenderingItemBorderTablix(num5, array2[rPLTablixCell.ColIndex], rPLTablixCell.RowIndex, rPLTablixCell.ColIndex, renderingItem);
                            if (rPLTablixMemberCell2 != null)
                            {
                                if (num3 < rPLTablix.ColumnHeaderRows)
                                {
                                    m_columnHeaderBorders.Add(renderingItemBorderTablix);
                                }
                                else
                                {
                                    renderingItemBorderTablix.CompareRowFirst = false;
                                    m_rowHeaderBorders.Add(renderingItemBorderTablix);
                                }
                            }
                            else
                            {
                                m_detailCellBorders.Add(renderingItemBorderTablix);
                            }
                        }
                    }
                    base.Children.Add(renderingItem);
                    fixedHeaderItem?.RenderingItems.Add(renderingItem);
                    if (rPLTablix.FixedColumns[rPLTablixCell.ColIndex])
                    {
                        fixedHeaderItem3.RenderingItems.Add(renderingItem);
                    }
                    if (fixedHeaderItem2 != null && rPLTablixCell is RPLTablixCornerCell)
                    {
                        fixedHeaderItem2.RenderingItems.Add(renderingItem);
                        fixedHeaderItem2.Bounds = renderingItem.Position;
                    }
                }
                num4 = num5;
                if (fixedHeaderItem != null)
                {
                    fixedHeaderItem.Bounds.Height += rPLTablix.RowHeights[num3];
                    if (num3 == rPLTablix.RowHeights.Length - 1 || !rPLTablix.FixedRow(num3 + 1))
                    {
                        fixedHeaderItem = null;
                    }
                }
                num  += rPLTablix.RowHeights[num3];
                num2 += rPLTablix.RowHeights[num3];
                num3++;
                for (int m = 0; m < nextRow.NumCells; m++)
                {
                    nextRow[m] = null;
                }
            }
            m_detailCellBorders.Sort(new ZIndexComparer());
            m_columnHeaderBorders.Sort(new ZIndexComparer());
            m_rowHeaderBorders.Sort(new ZIndexComparer());
            m_cornerBorders.Sort(new ZIndexComparer());
            RectangleF position = base.Position;

            if (array.Length != 0)
            {
                position.Width = array[array.Length - 1] + rPLTablix.ColumnWidths[rPLTablix.ColumnWidths.Length - 1];
            }
            position.Height = num;
        }
コード例 #4
0
 public virtual void ProcessFixedHeaders(RPLTablix tablix, RectangleF position, float[] rowStarts, float[] columnStarts)
 {
 }
コード例 #5
0
 private static void ReadTablixStructure(RPLTablix tablix, ALayout layout, int top, int left, int generationIndex, BlockOutlines blockOutlines, Dictionary <string, ToggleParent> toggleParents, bool suppressOutlines, string subreportLanguage)
 {
     if (tablix != null)
     {
         int num = 0;
         if (tablix.ColumnWidths != null)
         {
             num = tablix.ColumnWidths.Length;
         }
         int[] array = new int[num + 1];
         array[0] = left;
         double num2           = (double)left;
         int    num3           = 0;
         int    rowHeaderWidth = 0;
         for (int i = 1; i <= num; i++)
         {
             num2    += LayoutConvert.ConvertMMTo20thPointsUnrounded((double)tablix.ColumnWidths[i - 1]);
             array[i] = (int)Math.Round(num2);
             if (tablix.ColsBeforeRowHeaders == 0 && i == tablix.RowHeaderColumns)
             {
                 rowHeaderWidth = (int)Math.Round(num2 - (double)left);
             }
         }
         num3 = (int)Math.Round(num2 - (double)left);
         int num4 = 0;
         if (tablix.RowHeights != null)
         {
             num4 = tablix.RowHeights.Length;
         }
         int[] array2 = new int[num4 + 1];
         array2[0] = top;
         double num5 = (double)top;
         int    num6 = 0;
         int    columnHeaderHeight = 0;
         for (int j = 1; j <= num4; j++)
         {
             num5     += LayoutConvert.ConvertMMTo20thPointsUnrounded((double)tablix.RowHeights[j - 1]);
             array2[j] = (int)Math.Round(num5);
             if (j == tablix.ColumnHeaderRows)
             {
                 columnHeaderHeight = (int)Math.Round(num5 - (double)top);
             }
         }
         num6 = (int)Math.Round(num5 - (double)top);
         List <RelativeStaticLocation> list = new List <RelativeStaticLocation>();
         bool         flag = false;
         RPLTablixRow nextRow;
         while ((nextRow = tablix.GetNextRow()) != null)
         {
             bool flag2 = false;
             RelativeStaticLocation relativeStaticLocation = new RelativeStaticLocation();
             if (!suppressOutlines && nextRow.OmittedHeaders != null)
             {
                 for (int k = 0; k < nextRow.OmittedHeaders.Count; k++)
                 {
                     RPLTablixMemberCell rPLTablixMemberCell = nextRow.OmittedHeaders[k];
                     if (Reader.SetRelativeStaticLocation(rPLTablixMemberCell, layout, relativeStaticLocation, list, ref flag2))
                     {
                         flag = true;
                     }
                     Reader.ReadTablixCellProperties(rPLTablixMemberCell, layout, array2, array, generationIndex + 1, tablix.LayoutDirection == RPLFormat.Directions.RTL, blockOutlines, toggleParents, suppressOutlines, subreportLanguage);
                     nextRow.OmittedHeaders[k] = null;
                 }
             }
             for (int l = 0; l < nextRow.NumCells; l++)
             {
                 RPLTablixCell rPLTablixCell = nextRow[l];
                 if (!suppressOutlines)
                 {
                     RPLTablixMemberCell rPLTablixMemberCell2 = rPLTablixCell as RPLTablixMemberCell;
                     if (rPLTablixMemberCell2 != null && Reader.SetRelativeStaticLocation(rPLTablixMemberCell2, layout, relativeStaticLocation, list, ref flag2))
                     {
                         flag = true;
                     }
                 }
                 Reader.ReadTablixCellProperties(rPLTablixCell, layout, array2, array, generationIndex + 1, tablix.LayoutDirection == RPLFormat.Directions.RTL, blockOutlines, toggleParents, suppressOutlines, subreportLanguage);
                 nextRow[l] = null;
             }
             if (!suppressOutlines && flag2 && !layout.SummaryColumnAfter.HasValue)
             {
                 layout.SummaryColumnAfter = relativeStaticLocation.IsSummaryAfter();
             }
         }
         if (!suppressOutlines)
         {
             int num7 = 0;
             while (!layout.SummaryRowAfter.HasValue && num7 < list.Count)
             {
                 RelativeStaticLocation relativeStaticLocation2 = list[num7];
                 layout.SummaryRowAfter = relativeStaticLocation2.IsSummaryAfter();
                 num7++;
             }
             if (flag)
             {
                 layout.AddStructuralItem(top, left, num3, num6, ALayout.TablixStructStart + ALayout.TablixStructGenerationOffset * generationIndex, rowHeaderWidth, columnHeaderHeight, tablix.LayoutDirection == RPLFormat.Directions.RTL);
             }
         }
     }
 }