zoukankan      html  css  js  c++  java
  • winform npoi excel 样式设置

            IWorkbook excel = new HSSFWorkbook();//创建.xls文件
                ISheet sheet = excel.CreateSheet("sheet1"); //创建sheet
                int rowindex = 0;
                IRow row = sheet.CreateRow(rowindex++);//创建一行
                ICell cell = row.CreateCell(0);//创建一列
                cell.SetCellValue(linkLabel1.Text);
                ICellStyle style = excel.CreateCellStyle();
                //设置单元格的样式:水平对齐居中
                style.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center;
                //新建一个字体样式对象
                IFont font = excel.CreateFont();
                //设置字体加粗样式
                //font.Boldweight = short.MaxValue;
                //设置字体大小
                font.FontHeightInPoints = 15;
                //使用SetFont方法将字体样式添加到单元格样式中 
                style.SetFont(font);
                //将新的样式赋给单元格
                cell.CellStyle = style;
                //设置单元格的高度
                //row.Height = 20 * 20;
                ////设置单元格的宽度
                //sheet.SetColumnWidth(0, 30 * 256);
                sheet.AddMergedRegion(new CellRangeAddress(0, 0, 0, strArr.Length-1));
  • 相关阅读:
    veil-evasion免杀处理
    对程序"加料"
    堆栈溢出
    ICMP隧道 ptunnle
    socat流量操控
    DNS隧道 iodns
    dns隧道 dns2tcpd
    ssh X协议转发
    ssh动态端口转发
    ssh远程端口转发
  • 原文地址:https://www.cnblogs.com/aj407blogs/p/9780454.html
Copyright © 2011-2022 走看看