using NPOI.XSSF.Streaming;
using NPOI.XSSF.UserModel;
using (var fileStream = File.OpenWrite("xssf.xlsx"))
using (var workbook = new XSSFWorkbook())
{
var sheet = workbook.CreateSheet();
var row = sheet.CreateRow(0);
var cell = row.CreateCell(0);
cell.SetCellValue("first\r\nsecond");
workbook.Write(fileStream);
}
using (var fileStream = File.OpenWrite("sxssf.xlsx"))
using (var workbook = new SXSSFWorkbook())
{
var sheet = workbook.CreateSheet();
var row = sheet.CreateRow(0);
var cell = row.CreateCell(0);
cell.SetCellValue("first\r\nsecond");
workbook.Write(fileStream);
}
Issue Description
There is an inconsistency between behavior of XSSFWorkbook and SXSSFWorkbook. When \r\n is written SXSSF incorrectly writes two new lines, XSSF writes only one (and it's the correct behavior).
In XSSF the cell contains:
first
second
In SXSSF the cell contains:
first
second
It looks, the SXSSF incorrectly contain two new lines instead of only one, same as for XSSF.
NPOI Version
2.7.1
File Type
Upload the Excel File
Please attach your original Excel File to help us reproduce the issue
xssf.xlsx sxssf.xlsx
Reproduce Steps
Issue Description
There is an inconsistency between behavior of XSSFWorkbook and SXSSFWorkbook. When
\r\n
is written SXSSF incorrectly writes two new lines, XSSF writes only one (and it's the correct behavior).In XSSF the cell contains:
In SXSSF the cell contains:
It looks, the SXSSF incorrectly contain two new lines instead of only one, same as for XSSF.