












XSSFCellStyle headStyle = workBook.CreateCellStyle() as XSSFCellStyle;
headStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center;
XSSFFont font = workBook.CreateFont() as XSSFFont;
font.FontHeightInPoints = 10;
font.Boldweight = 700;
font.Color = IndexedColors.Red.Index;
headStyle.SetFont(font);
IRow gapRow = sheet.CreateRow(lineCount);
gapRow.CreateCell(3 + i).SetCellValue(line4[i]);
if (line4[i] != 0)
{
gapRow.GetCell(3 + i).CellStyle = headStyle;
}
主要问题是两个as不能省。
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。