Пример #1
0
        public override object Clone()
        {
            FloatElement localFloatElement = new FloatElement();

            localFloatElement.name = ("Float" + index++);
            localFloatElement.setRow(getRow());
            localFloatElement.setColumn(getColumn());
            localFloatElement.setLeftDistance(getLeftDistance());
            localFloatElement.setTopDistance(getTopDistance());

            Size size = new Size(getSize().Width, getSize().Height);

            localFloatElement.Location = Location;
            localFloatElement.setSize(size);

            if (getValue() != null)
            {
                if ((getValue() is ChartPainter))
                {
                    localFloatElement.setValue(((ChartPainter)getValue()).Clone());
                }
            }

            return(localFloatElement);
        }
Пример #2
0
        public List <FloatElement> InitFloatElements(SheetView Report)
        {
            FloatElements.Clear();
            foreach (IElement Element in Report.DrawingContainer.ContainedObjects)
            {
                if (Element is FloatElement)
                {
                    FloatElement localFloatElement = Element as FloatElement;
                    FloatElements.Add(localFloatElement);
                }
            }

            return(FloatElements);
        }
Пример #3
0
        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);
        }
Пример #4
0
 /// <summary>
 /// 删除浮动元素
 /// </summary>
 /// <param name="Element"></param>
 public void DelFloatElement(FloatElement Element)
 {
     ReportSheet.DrawingContainer.ContainedObjects.Remove(Element);
 }
Пример #5
0
 /// <summary>
 /// 添加浮动元素
 /// </summary>
 /// <param name="Element"></param>
 public void SetFloatElement(FloatElement Element)
 {
     ReportSheet.DrawingContainer.ContainedObjects.Add(Element);
 }
Пример #6
0
        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) });
        }