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

Free Support Forum - aspose.com

AutoFitColumns -> Stopped working after 22.10 update (docker)

Hello,
Any chance worksheet.AutoFitColumns(); function stopped working after 22.10 release?
We are getting ##### in every Excel cells that does not fit the default Excel cell width.
I can confirm this works on Windows, but does not work on Docker.
Tnx

@eyalmolad

Please share us a standalone project with docker file to reproduce the issue.

Attaching a sample code:

var file = "c:\\temp\\input.xlsx";
using var workbook = new Workbook(file);

var worksheet = workbook.Worksheets["Sheet1"];

var autoFitOpts = new AutoFitterOptions
{
	IgnoreHidden = true,
	AutoFitWrappedTextType = AutoFitWrappedTextType.Paragraph
};

worksheet.AutoFitColumns(autoFitOpts);

workbook.Save("c:\\temp\\input_1.xlsx");

A few notes:

  • This code does not work neither on Windows nor Docker.
  • I expect the G column to to be visible (we are getting XXXX).
  • I tried a few different variations of AutoFitterOptions -> same result.
  • This was working in 22.8 version.
    input.zip (7.5 KB)

@eyalmolad

In the origin post, you posted that it works on Windows, but in the last post, you posted that it does’t work on Windows. What is the difference?

I double checked this. Does not work on any of above.

@eyalmolad
I tried your code, the width of column G is 63 in both v22.8 and v22.10 on Windows. It is OK.
Could you please share us a standalone project to reproduce the issue? Also, share us the output xlsx file generated on your side.

...
worksheet.AutoFitColumns(autoFitOpts);

//width of Column G in pixel.
Console.WriteLine("{0}: {1}", CellsHelper.GetVersion(), worksheet.Cells.GetColumnWidthPixel(CellsHelper.ColumnNameToIndex("G")));
...

Sorry for the late response, I just isolated the issue.
The issue is 100% NOT related to Docker. It’s easily reproducible on Windows.
The same code attached to zip file, works in 22.9 Cells version, but gives incorrect results in 22.10 and 22.11.
It happens when trying to Save a specific area of cells to an HTML output

Attaching:
The Excel file.
The Program code.
Both html outputs.

Thanks
.AsposeDemo1.zip (14.9 KB)

@eyalmolad,

Thanks for the template file, output files and other artefacts.

We will evaluate your issue using your provided sample and get back to soon.

@eyalmolad

After an initial test, I am able to reproduce the issue as you mentioned. I found that some numbers are displayed as # or scientific number in the output HTML.

I have logged a ticket with an id “CELLSNET-52332” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

1 Like

@eyalmolad,

This is to inform you that your issue has been resolved now. The fix will be included in our upcoming release (Aspose.Cells v22.12) which is scheduled in the first half of December, 2022. You will also be notified when the next version is released.

1 Like