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

Free Support Forum - aspose.com

Autofit row feature working after double clicking the cell not before that

Hi!,
I have a licensed dll of aspose.cell, I am programmatically setting for auto-fit row feature for a set of rows, but when the excel sheet is being generated it’s not coming with the autofit feature. But after double clicking the cell and clicking somewhere else outside that cell,autofit for that row is happening.
Here is my code snippet

foreach (PolicyTrackerByPolicy r in PolicyTracker)
{
//---------some codes here-----
cells[b, c + 1].PutValue(r.Region);
cells[b, c + 2].PutValue(r.SubRegion);
cells[b, c + 3].PutValue(r.Country);
string Loc = r.LineOfCoverage.Replace("|", “, \n\r”);
string grp=r.Group.Replace("|", “, \n\r”);
cells[b, c + 4].PutValue(Loc);
cells[b, c + 5].PutValue(r.Entity);
cells[b, c + 6].PutValue(grp);
//------Some codes--------------
cells[b, c + 45].PutValue(r.PolicyComments);
cells[b, c + 46].PutValue(r.LastUpdatedDate);
worksheet.ActiveCell = cells[b, c + 46].Name;
for (int i = 0; i <= 46; i++)
{
Cell Temp = worksheet.Cells[worksheet.ActiveCell];
Temp.SetStyle(style);
Temp.Worksheet.AutoFitRow(Temp.Row);
}
b = b + 1;
c = 0;

}
Please help in fixing this issue as soon as possible

Hi,


Thanks for providing us some details.

We cannot trace the problem based on your code segment, we cannot execute nor we have your underlying data and template Excel file. To evaluate your issue properly, please provide us your sample code (runnable) or preferably a simple console application (you may zip it prior attaching here) to reproduce the issue on our end, we will check it soon. Also provide the template file(s) if you have any, this will help us to evaluate your issue precisely to consequently figure it out soon.

Also, please try our latest version/ fix: Aspose.Cells for .NET v8.3.1.x (if you are not already using it)

Thank you.