public static Point[] calculateLastColumnAndRowOfFloatElement(SheetView paramReport, FloatElement paramFloatElement) { int column = paramFloatElement.getColumn(); int row = paramFloatElement.getRow(); int leftdistance = paramFloatElement.getLeftDistance(); int topdistance = paramFloatElement.getTopDistance(); Size localSize = paramFloatElement.getSize(); DynamicValueList columnWidthList = new DynamicValueList(72, paramReport.Columns.Count); for (int j = 0; j < paramReport.Columns.Count; j++) { columnWidthList.set(j, Convert.ToInt32(paramReport.Columns[j].Width)); } DynamicValueList rowHeightList = new DynamicValueList(19, paramReport.Rows.Count); for (int j = 0; j < paramReport.Rows.Count; j++) { rowHeightList.set(j, Convert.ToInt32(paramReport.Rows[j].Height)); } int n = column; int i1 = row; int i2 = 0; int i3 = 0; int i4 = -leftdistance; for (int i5 = column; ; i5++) { i4 += columnWidthList.get(i5); if (i4 < localSize.Width) { continue; } n = i5; i2 = localSize.Width - (i4 - columnWidthList.get(i5)); break; } i4 = -topdistance; for (int i5 = row; ; i5++) { i4 += rowHeightList.get(i5); if (i4 < localSize.Height) { continue; } i1 = i5; i3 = localSize.Height - (i4 - rowHeightList.get(i5)); break; } return(new Point[] { new Point(n, i1), new Point(i2, i3) }); }
public static DynamicValueList getRowHeightList(SheetView paramReport) { int cCount = paramReport.GetLastNonEmptyColumn(NonEmptyItemFlag.Data) + 1; int rCount = paramReport.GetLastNonEmptyRow(NonEmptyItemFlag.Data) + 1; for (int m = 0; m < rCount; m++) { for (int n = 0; n < cCount; n++) { if (paramReport.Cells[m, n].Tag is GridElement) { cCount = Math.Max(cCount, paramReport.Cells[m, n].Column.Index + paramReport.Cells[m, n].ColumnSpan); rCount = Math.Max(rCount, paramReport.Cells[m, n].Row.Index + paramReport.Cells[m, n].RowSpan); } } } foreach (IElement Element in paramReport.DrawingContainer.ContainedObjects) { if (Element is FloatElement) { FloatElement localFloatElement = Element as FloatElement; Point[] arrayOfPoint = ReportHelper.calculateLastColumnAndRowOfFloatElement(paramReport, localFloatElement); cCount = Math.Max(cCount, arrayOfPoint[0].X); rCount = Math.Max(rCount, arrayOfPoint[0].Y); } } DynamicValueList localDynamicValueList = new DynamicValueList(19, rCount); for (int j = 0; j < rCount; j++) { localDynamicValueList.set(j, Convert.ToInt32(paramReport.Rows[j].Height)); } return(localDynamicValueList); }