We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to Automatically wrap cell content without width or height using aspose.cell using dotnet

Hi Team,
I need to wrap the text in a cell automatically? is there a way do it in aspose.cells.
As we do in excel directly

Thanks,
Aneesh

@neemlal,
See the document with example code for your reference:

Hope, this helps a bit.

Thanks for the quick response, but in the example you have shared it has fixed width and height then only wrapping happens, but what if the text/context goes beyond the fixed width/height provided.

Thanks,
Aneesh

@neemlal,

Please call auto-fit row to wrap text automatically in the cell. See the following sample line of code:
e.g
Sample code:

//Autofit first row

    worksheet.AutoFitRow(0);

Also, please note, you should at least first set the column’s with (if you do not want to set the row height in code) because if you do not specify the column’s width, it will use existing width of the column in the worksheet (which is just 8.43 units (64 pixels) normally).