\n doesn't work on excel-cell
<p>I have got a problem to create new lines into a cell. When I create a file, the new lines aren't shown in correct way. I hope someone can help me to solve this issue.</p>

<pre><code>    cell.setCellValue(text);
if(text.indexOf(System.getProperty("line.separator")) != -1)
{
    int countRows = text.split(System.getProperty("line.separator")).length;
    style.setWrapText(true);
    cell.setCellStyle(style);
    row.setHeightInPoints((countRows * sheet.getDefaultRowHeightInPoints()));
    sheet.autoSizeColumn((short) countRows);
}
</code></pre>

<p>This is my Excel-File</p>

<p><a href="https://i.stack.imgur.com/Oteov.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Oteov.png" alt="enter image description here"></a></p>

<p>When I make a new Excel-File, all the cells are looking like cell A1. There isn't a new line. When I click on the cell A1 shows the description over the cell the content with the new lines.</p>

<p>I made a double click in cell A2 and the cell is showing the content in the correct way.</p>

<p>The new line tag seems to work. My issue is, that the new line isn't shown at the cell in the excel file. But it is shown at the cell description. Is there a way to show all of the cells like the cell A2 without a double click?</p>

<p>Thanks</p>