Free Support Forum - aspose.com

Cell column width as per its content

Hi Support Team,


I need to keep cell column width as per its content
When I try to put long string say “I need to put long string” ,I see only
"I need to put " although when I click on cell I can see complete string in formula bar.

I tried worksheet.autoResizeColumns();
but it didn’t work.


Regards,
Ankit

Hi,


Well, you need to Auto-fit feature to fit the contents into the cells of rows/columns accordingly.

I think you may try the following API to Auto-fit all the columns in single command:
worksheet.autoFitColumns()

Please see the document for your reference:

http://www.aspose.com/docs/display/cellsjava/AutoFit+Rows+and+Columns

Hi


Thanks for the reply.

I tried autoResize columns but its not working for me I am using aspose.cells version 7.3.0

I noticed one thing that if I can increase row height then also the problem can be solved.

But when i tried
sheet.autoFitRow(row, c, c2); —>Row height gets very large with respect to content in cell

sheet.autoFitRow®;–>This isn’t fixing the problem

I just want to display all the content in cell either by increasing row height or column width

Please suggest me the solution.

Regards,
Ankit

Hi,


Please try to use our latest version e.g v7.4.0 (you may download it from the Downloads module of Aspose site).

If you still find the issue, kindly give us your template files and paste your runnable sample code to reproduce the issue on our end. We will check your issue soon.

Thank you.