1

I am using NPOI to export some data to excel, inside a cell I am inserting 3 items with 2 lines breaks so I am adjusting the row height accordingly:

var row = sheet.CreateRow(1);
row.Height = 900;

var questionString = "Question 1" + Environment.NewLine + "Question 2" + Environment.NewLine;

When exporting the excel the row height is adjusted, however the contents of the cell are clustered unless I double click on the cell.

Result when exporting:

Before

Result after double clicking on the cells:

After

  • How are you writing to the cell? Perhaps you need `Environment.NewLine` to separate content. – shahkalpesh Mar 21 '23 at 07:11
  • I am adding Environment.NewLine, I have updated the question – Osama El-Masri Mar 21 '23 at 08:56
  • Does this answer your question? [How to insert a linebreak as the data of a cell using Apache POI?](https://stackoverflow.com/questions/48040638/how-to-insert-a-linebreak-as-the-data-of-a-cell-using-apache-poi) – shahkalpesh Mar 21 '23 at 09:32

0 Answers0