How to set the height of an Excel row in NPOI?

0

I'm trying to create a line in an excel file through the NPOI library. The problem is that I do not know how to set a size for the line. Currently, the line is capping the content of the text.

How can I set the height of the line (if possible automatic height)?

private static void CreateHeader(IRow row, List<string> header)
{

    HSSFWorkbook wb = new HSSFWorkbook();

    ISheet sheet = wb.CreateSheet("Modelo");

    ICellStyle style = wb.CreateCellStyle();

    IRow row = row.CreateRow(0);

    for (int i = 0; i < header.Count; i++)
    {
        ICell cell = row.CreateCell(i);

        cell.SetCellValue(header[i]);

        cell.CellStyle = style;
    }            
}
    
asked by anonymous 21.07.2017 / 16:47

1 answer

0

I've discovered that there are two properties in IRow that allows setting line height:

IRow row = row.CreateRow(0);
row.Height = 10;
row.HeightInPoints = 20;

The error was happening when I tried to set it through row.RowStyle.Height .

    
21.07.2017 / 17:58