/// <summary>
        /// Sets Head and foot flags
        /// </summary>
        /// <param name="flags">The flags.</param>
        public void setFromFlags(cursorVariatorHeadFootFlags flags)
        {
            if ((flags & cursorVariatorHeadFootFlags.doFootZone) == cursorVariatorHeadFootFlags.doFootZone)
            {
                _footZone = 1;
            }

            if ((flags & cursorVariatorHeadFootFlags.doFootZoneBig) == cursorVariatorHeadFootFlags.doFootZoneBig)
            {
                _footZone = 2;
            }

            if ((flags & cursorVariatorHeadFootFlags.doFootExtendedZone) == cursorVariatorHeadFootFlags.doFootExtendedZone)
            {
                _footZoneExtension = 1;
            }

            if ((flags & cursorVariatorHeadFootFlags.doHeadZone) == cursorVariatorHeadFootFlags.doHeadZone)
            {
                _headZone = 1;
            }

            if ((flags & cursorVariatorHeadFootFlags.doHeadZoneBig) == cursorVariatorHeadFootFlags.doHeadZoneBig)
            {
                _headZone = 2;
            }

            if ((flags & cursorVariatorHeadFootFlags.doHeadExtenedZone) == cursorVariatorHeadFootFlags.doHeadExtenedZone)
            {
                _headZoneExtension = 1;
            }

            if ((flags & cursorVariatorHeadFootFlags.doLeftZone) == cursorVariatorHeadFootFlags.doLeftZone)
            {
                _leftZone = 1;
            }

            if ((flags & cursorVariatorHeadFootFlags.doRightZone) == cursorVariatorHeadFootFlags.doRightZone)
            {
                _rightZone = 1;
            }
        }
        /// <summary>
        /// Sets the variator flags.
        /// </summary>
        /// <param name="data">The data.</param>
        /// <param name="headFoot">The head foot.</param>
        /// <param name="tableOps">The table ops.</param>
        /// <param name="oddEven">The odd even.</param>
        /// <param name="container">The container.</param>
        /// <returns></returns>
        public static PropertyCollection setVariatorFlags(this PropertyCollection data, cursorVariatorHeadFootFlags headFoot, appendTableOptionFlags tableOps, cursorVariatorOddEvenFlags oddEven, styleFourSide container)
        {
            if (data == null)
            {
                data = new PropertyCollection();
            }

            data.addObjectToMultikeys(headFoot, true, templateFieldStyle.style_headFootFlags);
            data.addObjectToMultikeys(tableOps, true, templateFieldStyle.style_appendTableOptionFlags);
            data.addObjectToMultikeys(oddEven, true, templateFieldStyle.style_oddEvenFlags);
            data.addObjectToMultikeys(container, true, templateFieldStyle.style_containerStyle);

            return(data);
        }
Exemple #3
0
 public dataProviderForStyler(cursorVariatorHeadFootFlags headFoot, appendTableOptionFlags tableOps, cursorVariatorOddEvenFlags oddEven, styleFourSide container, acePaletteRole mainColor, acePaletteRole layoutColor)
 {
     this.setColors(mainColor, layoutColor);
     this.setVariatorFlags(headFoot, tableOps, oddEven, container);
 }
Exemple #4
0
        /// <summary>
        /// Inserts DataTable content at current currsor position. Options: doInsertCaptions, doInsertRowID columnprefix (this is abanded)
        /// </summary>
        /// <param name="worksheet">The worksheet.</param>
        /// <param name="cur">The current.</param>
        /// <param name="data">The data.</param>
        /// <param name="doInsertCaptions">if set to <c>true</c> [do insert captions].</param>
        /// <param name="doInsertRowId">if set to <c>true</c> [do insert row identifier].</param>
        /// <returns>Range of newly populated cells, including automatically created extra row and column</returns>
        public static ExcelRange SetDataTable(this ExcelWorksheet worksheet, cursor cur, DataTable data, cursorVariatorHeadFootFlags headFootFlags, cursorVariatorOddEvenFlags oddEvenFlags)
        {
            int twidth  = data.Columns.Count;
            int theight = data.Rows.Count;

            bool doInsertCaptions = false;

            bool doInsertRowId = false;

            if (doInsertCaptions)
            {
                theight++;
            }

            if (doInsertRowId)
            {
                twidth++;
            }

            cur.setTempFrame(twidth, theight, textCursorZoneCorner.UpLeft, 0, 0); //.//.switchToZone(textCursorZone.innerZone, textCursorZoneCorner.UpLeft);
            cur.switchToZone(textCursorZone.innerZone);

            if (doInsertCaptions)
            {
                if (doInsertRowId)
                {
                    SetValue(worksheet, cur, "#", false, textCursorZoneCorner.Right);
                }
                foreach (DataColumn dc in data.Columns)
                {
                    SetValue(worksheet, cur, dc.Caption, false, textCursorZoneCorner.Right);
                }
                cur.enter();
            }

            foreach (DataRow rw in data.Rows)
            {
                if (doInsertRowId)
                {
                    SetValue(worksheet, cur, data.Rows.IndexOf(rw), false, textCursorZoneCorner.Right);
                }
                foreach (DataColumn dc in data.Columns)
                {
                    SetValue(worksheet, cur, rw[dc], false, textCursorZoneCorner.Right);
                }
                cur.enter();
            }

            var area = cur.selectZoneArea();

            cur.backToMainFrame();

            return(area.getExcelRange(worksheet));
        }