日期:2014-05-17 浏览次数:20472 次
using (FileStream file = new FileStream(xlsPath, FileMode.Open, FileAccess.Read))
{
HSSFWorkbook xls = new HSSFWorkbook(file); //创建一个xls;
ISheet sheet = xls.GetSheet(sheetName); //在这sheet一直都是null
file.Close();
HSSFFont font = (HSSFFont)xls.CreateFont();
HSSFCellStyle style1 = (HSSFCellStyle)xls.CreateCellStyle();
font.Boldweight = (short)NPOI.SS.UserModel.FontBoldWeight.BOLD;
}