Beispiel #1
0
        /// <summary>
        /// To put a table within the existing table at the given position
        /// generateTable will of course re-arrange the widths of the columns.
        /// </summary>
        /// <param name="aTable">the table you want to insert</param>
        /// <param name="aLocation">a Point</param>
        public void InsertTable(Table aTable, Point p)
        {
            if (aTable == null) throw new Exception("insertTable - table has null-value");

            mTableInserted = true;
            aTable.Complete();
            if (p.Y > columns)
                throw new ArgumentException("insertTable -- wrong columnposition("+ p.Y + ") of location; max =" + columns);
            int rowCount = p.X + 1 - rows.Count;
            int i = 0;
            if ( rowCount > 0 ) {   //create new rows ?
                for (; i < rowCount; i++) {
                    rows.Add(new Row(columns));
                }
            }

            ((Row) rows[p.X]).SetElement(aTable,p.Y);

            CurrentLocationToNextValidPosition = p;
        }
Beispiel #2
0
        // constructors
        /**
         * Constructs a <CODE>PdfTable</CODE>-object.
         *
         * @param   table   a <CODE>Table</CODE>
         * @param   left    the left border on the page
         * @param   right   the right border on the page
         * @param   top     the start position of the top of the table
         */
        internal PdfTable(Table table, float left, float right, float top)
            : base(left, top, right, top)
        {
            // constructs a Rectangle (the bottomvalue will be changed afterwards)
            this.table = table;
            table.Complete();

            // copying the attributes from class Table
            CloneNonPositionParameters(table);

            this.columns = table.Columns;
            positions = table.GetWidths(left, right - left);

            // initialisation of some parameters
            Left = positions[0];
            Right = positions[positions.Length - 1];

            headercells = new ArrayList();
            cells = new ArrayList();

            UpdateRowAdditionsInternal();
        }