示例#1
0
        private void SetStyleForRow()
        {
            #region 标题行
            cellstyleForOneRow = (HSSFCellStyle)WorkBook.CreateCellStyle();
            HSSFFont font = (HSSFFont)WorkBook.CreateFont();
            font.Color = HSSFColor.BLACK.index;
            font.FontHeightInPoints = 15;
            cellstyleForOneRow.SetFont(font);
            #endregion

            #region 校验失败行
            cellstyleForVerifyFailed = (HSSFCellStyle)WorkBook.CreateCellStyle();
            cellstyleForVerifyFailed.FillForegroundColor = HSSFColor.LIGHT_ORANGE.index;
            cellstyleForVerifyFailed.FillPattern         = FillPatternType.SOLID_FOREGROUND;
            HSSFFont font1 = (HSSFFont)WorkBook.CreateFont();
            font1.Color = HSSFColor.BLACK.index;
            font1.FontHeightInPoints = 12;
            cellstyleForVerifyFailed.SetFont(font1);
            #endregion

            #region 校验成功行
            cellstyleForVerifySuccess = (HSSFCellStyle)WorkBook.CreateCellStyle();
            cellstyleForVerifySuccess.FillForegroundColor = HSSFColor.SKY_BLUE.index;
            cellstyleForVerifySuccess.FillPattern         = FillPatternType.SOLID_FOREGROUND;
            HSSFFont font2 = (HSSFFont)WorkBook.CreateFont();
            font2.Color = HSSFColor.BLACK.index;
            font2.FontHeightInPoints = 12;
            cellstyleForVerifySuccess.SetFont(font2);
            #endregion
        }
示例#2
0
        private IFont CriarFonte()
        {
            IFont fonte = WorkBook.CreateFont();

            fonte.FontHeightInPoints = 12;
            fonte.FontName           = "Calibri";
            return(fonte);
        }
        private IFont getDefaultFont( )
        {
            var font = WorkBook.CreateFont();

            font.FontHeightInPoints = 11;
            font.FontName           = "Arial";
            font.IsBold             = false;

            return(font);
        }
        public void SetHeadersBold()
        {
            var font = WorkBook.CreateFont();

            font.FontHeightInPoints = 11;
            font.FontName           = "Arial";
            font.IsBold             = true;

            HeadersStyle = WorkBook.CreateCellStyle();
            HeadersStyle.SetFont(font);
        }