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

Free Support Forum - aspose.com

AutoFitRow method problem

Hi,
Using your Aspose.Excel component I’m generating programmatically excel files. After my code completes putting needed values in right cells, I have a code that goes through existing row and using AutoFitRow() method I’m trying to adjust the row height. Here is the code that I use:

for (int i = FirstRow; i <= LastRow; i++)
{
report.Worksheet.AutoFitRow(i);
}

After, saving and opening generated excel files I see that some of the rows are not adjusted correctly and the text in cells is cut. Though, if I try to do auto row height adjustment using MS Excel, everything displays fine and well-adjusted. The row height has enough place, it’s not close to Excel row height limit. The text that cells contain doesn’t have spaces at the end of text. My Aspose.Excel.dll Assembly version is: 1.8.8.1
Please help me.
Thanks.

Hi,

Could you email me your file created by Aspose.Excel?

I sent an excel file to excel@aspose.com

Carbon

Hi Carbon,

I got it. It will be fixed in the next hotfix within two days.

@carbon,
I would like to share the Aspose.Excel is more available now and discontinued. A new product Aspose.Cells is introduced which contains rich features and is better than the previous product in terms of performance and stability. This new product also supports auto fitting the rows and columns as demonstrated in the following example:

// Creating a file stream containing the Excel file to be opened
FileStream fstream = new FileStream(InputPath, FileMode.Open);

// Opening the Excel file through the file stream
Workbook workbook = new Workbook(fstream);

// Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.Worksheets[0];

// Auto-fitting the 3rd row of the worksheet
worksheet.AutoFitRow(1);

// Saving the modified Excel file
workbook.Save(dataDir  + "output.xlsx");

// Closing the file stream to free all resources
fstream.Close();

Here is link to the document where more details are available:
Autofit Rows and Columns

Following is the link to the latest version of this product:
Aspose.Cells for .NET (Latest Version)

A running solution is available here for testing all the exciting features of this product.