Ii have applied NPOI to generate the excel. So far so good except that I want to bold a row.
I have tried:
tmpRow.RowStyle = workbook.CreateCellStyle();
tmpRow.RowStyle.SetFont(boldFont);
However, nothing has changed.
While I can do it by setting it one by one:
ICellStyle boldFontCellStyle = workbook.CreateCellStyle();
IFont boldFont = workbook.CreateFont();
boldFont.IsBold = true;
boldFontCellStyle.SetFont(boldFont);
for (int p= 0; p <= 12; p++)
{
tmpRow.GetCell(p).CellStyle = boldFontCellStyle;
}
//tmpRow.RowStyle = workbook.CreateCellStyle();
//tmpRow.RowStyle.SetFont(boldFont);
I would like to know if there is any way to set an entire row style in NPOI?
Thanks.
Generate style, set it and then apply it to row. Something like this: