Hello,
We have a cell that has a newline and some empty spaces after that.
The empty spaces are not rendered.
Below is the sample code, please notice the difference when we add the “1”.
var tempWorkbook = new Workbook(FileFormatType.Xlsx);
var ws = tempWorkbook.Worksheets[0];
var cell = ws.Cells;
var sb = new StringBuilder();
sb.Append(“test”).Append(Environment.NewLine).Append(" a");
tempWorkbook.Worksheets[0].Cells[1, 1].Value = sb.ToString();
sb.Clear();
sb.Append(“test”).Append(Environment.NewLine).Append(“1 a”);
tempWorkbook.Worksheets[0].Cells[2, 2].Value = sb.ToString();
Aspose.Cells.Style oStyle = cell[1, 1].GetStyle();
oStyle.IsTextWrapped = true;
ws.Cells[1, 1].SetStyle(oStyle);
ws.Cells[2, 2].SetStyle(oStyle);
tempWorkbook.Worksheets[0].AutoFitColumns();
tempWorkbook.Worksheets[0].AutoFitRows();
var sheetRender = new SheetRender(tempWorkbook.Worksheets[0], new ImageOrPrintOptions());
sheetRender.ToImage(0).Save(“c:/test.bmp”);
Best regards,
Stefan Botan ,
IBM Romania