Ejemplo n.º 1
0
        /// <summary>
        /// Add right border to cell
        /// </summary>
        /// <param name="type">Border Style</param>
        /// <param name="size">Border Width</param>
        /// <param name="space"></param>
        /// <param name="rgbColor">Border Color</param>
        public void SetBorderRight(XWPFTable.XWPFBorderType type, int size, int space, String rgbColor)
        {
            CT_TcPr      ctTcPr  = GetCTTc().IsSetTcPr() ? GetCTTc().tcPr : GetCTTc().AddNewTcPr();
            CT_TcBorders borders = ctTcPr.tcBorders == null?ctTcPr.AddNewTcBorders() : ctTcPr.tcBorders;

            borders.right = CreateBorder(type, size, space, rgbColor);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates border with parameters
        /// </summary>
        /// <param name="type">Border Style</param>
        /// <param name="size">Border Width</param>
        /// <param name="space">Border Spacing Measurement</param>
        /// <param name="rgbColor">Border Color</param>
        /// <returns>CT_Border object</returns>
        private static CT_Border CreateBorder(XWPFTable.XWPFBorderType type, int size, int space, string rgbColor)
        {
            CT_Border border = new CT_Border();

            border.val   = XWPFTable.xwpfBorderTypeMap[type];
            border.sz    = (ulong)size;
            border.space = (ulong)space;
            border.color = (rgbColor);
            return(border);
        }
Ejemplo n.º 3
0
        public void SetInsideVBorder(XWPFTable.XWPFBorderType type, int size, int space, string rgbColor)
        {
            CT_TblPr      trPr         = this.GetTrPr();
            CT_TblBorders ctTblBorders = trPr.IsSetTblBorders() ? trPr.tblBorders : trPr.AddNewTblBorders();
            CT_Border     ctBorder     = ctTblBorders.IsSetInsideV() ? ctTblBorders.insideV : ctTblBorders.AddNewInsideV();

            ctBorder.val   = XWPFTable.xwpfBorderTypeMap[type];
            ctBorder.sz    = (ulong)size;
            ctBorder.space = (ulong)space;
            ctBorder.color = rgbColor;
        }
Ejemplo n.º 4
0
        public XWPFTable.XWPFBorderType GetInsideVBorderType()
        {
            XWPFTable.XWPFBorderType xwpfBorderType = XWPFTable.XWPFBorderType.NONE;
            CT_TblPr trPr = this.GetTrPr();

            if (trPr.IsSetTblBorders())
            {
                CT_TblBorders tblBorders = trPr.tblBorders;
                if (tblBorders.IsSetInsideV())
                {
                    CT_Border insideV = tblBorders.insideV;
                    xwpfBorderType = XWPFTable.stBorderTypeMap[insideV.val];
                }
            }
            return(xwpfBorderType);
        }
Ejemplo n.º 5
0
        public void SetBorderBottom(XWPFTable.XWPFBorderType type, int size, int space, String rgbColor)
        {
            CT_TcPr ctTcPr = null;

            if (!GetCTTc().IsSetTcPr())
            {
                ctTcPr = GetCTTc().AddNewTcPr();
            }
            CT_TcBorders borders = ctTcPr.AddNewTcBorders();

            borders.bottom = new CT_Border();
            CT_Border b = borders.bottom;

            b.val   = XWPFTable.xwpfBorderTypeMap[type];
            b.sz    = (ulong)size;
            b.space = (ulong)space;
            b.color = (rgbColor);
        }