NPOI Page Breaks

前端 未结 2 1611
一生所求
一生所求 2021-01-27 07:38

I am using the NPOI framework to generate a 97/2003 Excel workbook. I need to set a page break every 44 rows and from the example provided in the framework download, the code to

2条回答
  •  情书的邮戳
    2021-01-27 07:53

    Are you saving the file after you make the changes in POI?

    I tried this, and it worked fine as long as the file was saved afterward:

    for(int rowCount = 43; rowCount < sheet.LastRowNum; rowCount += 44)
    {
        worksheet.SetRowBreak(rowCount);
    }
    

提交回复
热议问题