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); } } } }
public static int CalculateZIndex(RPLTablixMemberCell header) { int num = header.TablixMemberDef.Level * 3; if (!header.TablixMemberDef.StaticHeadersTree) { num--; } return(num); }
private int CalculateZIndex(RPLTablixMemberCell header, bool forHeader) { int num = header.TablixMemberDef.Level * 3; if (!header.TablixMemberDef.StaticHeadersTree) { num--; } if (!forHeader) { num--; } return(num); }
public void SetIndexes(RPLTablixMemberCell member, bool isColumn) { if (member.TablixMemberDef.IsStatic) { if (this.m_staticBeforeIndex == -1 && this.m_toggleIndex == -1) { this.m_staticBeforeIndex = (isColumn ? member.ColIndex : member.RowIndex); } if (this.m_staticAfterIndex == -1 && this.m_toggleIndex > -1) { this.m_staticAfterIndex = (isColumn ? member.ColIndex : member.RowIndex); } } else if (member.HasToggle && this.m_toggleIndex == -1) { this.m_toggleIndex = (isColumn ? member.ColIndex : member.RowIndex); } }
public static int CalculateRowZIndex(RPLTablixRow row) { int num = 2147483647; for (int i = 0; i < row.NumCells; i++) { RPLTablixMemberCell rPLTablixMemberCell = row[i] as RPLTablixMemberCell; if (rPLTablixMemberCell != null) { num = Math.Min(num, SharedRenderer.CalculateZIndex(rPLTablixMemberCell)); } } if (row.OmittedHeaders != null && row.OmittedHeaders.Count > 0) { for (int j = 0; j < row.OmittedHeaders.Count; j++) { num = Math.Min(num, SharedRenderer.CalculateZIndex(row.OmittedHeaders[j])); } } return(num); }
internal static int CalculateRowZIndex(RPLTablixRow row) { int num = int.MaxValue; for (int i = 0; i < row.NumCells; i++) { RPLTablixMemberCell rPLTablixMemberCell = row[i] as RPLTablixMemberCell; if (rPLTablixMemberCell != null) { num = Math.Min(num, CalculateZIndex(rPLTablixMemberCell)); } } if (row.OmittedHeaders != null && row.OmittedHeaders.Count > 0) { for (int j = 0; j < row.OmittedHeaders.Count; j++) { num = Math.Min(num, CalculateZIndex(row.OmittedHeaders[j])); } } return(num); }
private static bool SetRelativeStaticLocation(RPLTablixMemberCell member, ALayout layout, RelativeStaticLocation staticLocation, List <RelativeStaticLocation> rowHeaderStaticLocations, ref bool isColumn) { if (member.TablixMemberDef.IsColumn) { isColumn = true; if (!layout.SummaryColumnAfter.HasValue) { if (member.IsRecursiveToggle) { layout.SummaryColumnAfter = false; } else { staticLocation.SetIndexes(member, true); } } } else { isColumn = false; if (!layout.SummaryRowAfter.HasValue) { if (member.IsRecursiveToggle) { layout.SummaryRowAfter = false; } else { int level = member.TablixMemberDef.Level; for (int i = rowHeaderStaticLocations.Count; i <= level; i++) { rowHeaderStaticLocations.Add(new RelativeStaticLocation()); } RelativeStaticLocation relativeStaticLocation = rowHeaderStaticLocations[level]; relativeStaticLocation.SetIndexes(member, false); } } } return(member.HasToggle); }
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; }
public abstract void AddStructuralItem(int top, int left, int width, int height, bool isToggglable, int generationIndex, RPLTablixMemberCell member, TogglePosition togglePosition);
internal override void AddStructuralItem(int top, int left, int width, int height, bool isToggglable, int generationIndex, RPLTablixMemberCell member, TogglePosition togglePosition) { }
private static void ReadTablixCellProperties(RPLTablixCell cell, ALayout layout, int[] rowTops, int[] columnLefts, int generationIndex, bool isRTL, BlockOutlines blockOutlines, Dictionary <string, ToggleParent> toggleParents, bool suppressOutlines, string subreportLanguage) { int num = columnLefts[cell.ColIndex]; int num2 = rowTops[cell.RowIndex]; int num3 = columnLefts[cell.ColIndex + cell.ColSpan] - num; int num4 = rowTops[cell.RowIndex + cell.RowSpan] - num2; bool flag = false; if (num3 == 0 && cell.ColSpan != 0) { return; } if (num4 == 0 && cell.RowSpan != 0) { return; } if (!suppressOutlines && cell is RPLTablixMemberCell && blockOutlines != (BlockOutlines)3) { RPLTablixMemberCell rPLTablixMemberCell = (RPLTablixMemberCell)cell; TogglePosition togglePosition = TogglePosition.None; flag = rPLTablixMemberCell.HasToggle; if (rPLTablixMemberCell.TablixMemberDef.IsColumn) { if ((blockOutlines & BlockOutlines.Columns) != 0) { flag = false; } togglePosition = TogglePosition.Above; } else { if ((blockOutlines & BlockOutlines.Rows) != 0) { flag = false; } togglePosition = (TogglePosition)((!isRTL) ? 1 : 2); } int left = num; if (isRTL && num3 == 0 && cell.ColIndex > 0) { left = columnLefts[cell.ColIndex - 1]; } layout.AddStructuralItem(num2, left, num3, num4, flag, generationIndex, rPLTablixMemberCell, togglePosition); } RPLItem element = cell.Element; if (element != null) { byte b = default(byte); RPLItemProps itemProps = layout.RPLReport.GetItemProps(element.RPLSource, out b); if (b == 7) { RPLTextBoxPropsDef rPLTextBoxPropsDef = (RPLTextBoxPropsDef)itemProps.Definition; if (rPLTextBoxPropsDef.IsSimple) { layout.AddReportItem(element.RPLSource, num2, num, num3, num4, generationIndex, cell.ElementState, subreportLanguage, toggleParents); } else { layout.AddReportItem(element, num2, num, num3, num4, generationIndex, cell.ElementState, subreportLanguage, toggleParents); } if (!suppressOutlines && rPLTextBoxPropsDef.IsToggleParent && !toggleParents.ContainsKey(rPLTextBoxPropsDef.Name)) { toggleParents.Add(rPLTextBoxPropsDef.Name, new ToggleParent(num2, num, num3, num4)); } } else { layout.AddReportItem(element.RPLSource, num2, num, num3, num4, generationIndex, cell.ElementState, subreportLanguage, toggleParents); } if (!suppressOutlines) { if (rowTops.Length > 2) { blockOutlines |= BlockOutlines.Columns; } if (columnLefts.Length > 2) { blockOutlines |= BlockOutlines.Rows; } } Reader.ReadMeasurement(element, layout, num2, num, generationIndex + 1, blockOutlines, toggleParents, suppressOutlines, num3, subreportLanguage); } }
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); } } } }