Aspose Cells AutoFitColumns with trailing spaces

I am using Aspose Cells DLL version 6.0.1.

I have found an inconsistency in the AutoFitColumns with cell values containing trailing spaces. When I only have 9 cells with trailing spaces, the column auto-fits correctly with the header. When I have 10 cells, the auto-fit ignores the header cell value leaving the column too small.

Dim BOOK As New Aspose.Cells.Workbook

Dim SHEET = BOOK.Worksheets.Item(1 - 1)

SHEET.Cells(0, 2).Value = "ADJUSTMENT"

For i As Integer = 1 To 10

SHEET.Cells(i, 2).Value = "Lock "

Next i

SHEET.AutoFitColumns()

BOOK.Save("A.xls", Aspose.Cells.SaveFormat.Excel97To2003)

Hi,


I could not find the issue as you mentioned. I have attached the output file using your code. Please make sure that you are using latest version v6.0.1.

Thank you.

I have confirmed that I am using version 6.0.1. I didn't notice that the trailing spaces were truncated from my post. This is a better example.

Dim BOOK As New Aspose.Cells.Workbook

Dim SHEET = BOOK.Worksheets.Item(1 - 1)

SHEET.Cells(0, 2).Value = "ADJUSTMENT"

For i As Integer = 1 To 10

SHEET.Cells(i, 2).Value = "Lock" & New String(" ", 16)

Next i

SHEET.AutoFitColumns()

BOOK.Save("A.xls", Aspose.Cells.SaveFormat.Excel97To2003)

When you change the loop to end on 9, the problem disappears.

Hi,


Now, I can find the issue as you have mentioned. I have logged a ticket for the issue with an id: CELLSNET-29293. We will figure it out soon.

thank you.

Hi,

We have fixed this issue.Please download Aspose.Cells for .NET v6.0.1.1.

The issues you have found earlier (filed as 29293) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.