I’ve noticed that the AutoFitColumns() method does not get columns as narrow as Excel’s auto-fitting. I’d just like to know what the reason(s) for this is/are as of the current version (7.1.1.)
Thanks for the reply Amjad. I’m not seeing any issue with the way the auto-fitting is currently working; I’m just getting questions from users asking why things aren’t packed in as tightly as possible horizontally.
If it is the case that a little padding is being put in when auto-fitting column(s) to try appease the two camps you mentioned (those who want auto-fit to get things as narrow as possible and those who want auto-fit to leave a little extra room), then would it be possible for Aspose to provide an overload of AutoFitColumns and/or AutoFitColumn in a future release that would allow a developer to specify how much (if any) extra padding they’d like as a parameter?
Thanks for your posting.
Padding actually depends on the type and size of fonts.
Ms-Excel uses Win32 native APIs for graphics, while Aspose.Cells uses .NET framework APIs so minor issues in autofitting will remain.
Being a managed component, Aspose.Cells cannot use Win32 native APIs for graphical metrics, rendering etc.
Anyway, please provide us your sample files, screenshots and sample project replicating the problems, we will look into them and update you asap.
Aspose.Cells.Workbook w = new Aspose.Cells.Workbook(@“c:\temp\book1.xlsx”);
w.Worksheets.Cells[“A1”].Value = 80456362.16 ;
w.Worksheets.Cells[“A2”].Value = 13489467.16 ;
w.Worksheets.Cells[“B1”].Value = DateTime.Now;
w.Worksheets.Cells[“C1”].Value = 80456362.16;
w.Worksheets.Cells[“C2”].Value = 13489467.16;
w.Worksheets.Cells[“D1”].Value = 80456362.16;
w.Worksheets.Cells[“D2”].Value = 13489467.16;
We have fixed this issue. Please download and try:
for .NET v22.214.171.124
Good to know that your issue is sorted out.
We updated a project to 126.96.36.199 from 188.8.131.52 - because the hyperlink sorting item we thought was solved in 184.108.40.206, this is another question later. For now we noticed that the AutoFitColumns does not work like it did in 220.127.116.11. I ran the sample listed above by the user and sure enough it does not appear to be working as it did before. Can you check on this?
I just confirmed that the issue appears to be corrected in 8.1.0, we will go ahead and move up to that for this particular application.
Hi Mark Warner,
I understand that using the latest is typically the best it can also introduce issues that is not easy to resolve.
Hi Mark Warner,
Thanks for your posting and using Aspose.Cells.
Hopefully, you will not encounter any newer issue while upgrading to latest version. In case, you encounter any issue, we will be quick to resolve it. Please feel free to post here if you face any issue or have any other question.