Performance of setting column widths with autofitting using Aspose.Cells for Java

Dear Warren,

Has something been changed regarding column widths and/or autofitting recently? It appears all of our column are approx. twice the size of the text in them.

Another thing, would you consider implementing a version of your autofitting methods that only takes samples. The reason for this request is that calling autofit for large sheets is really slow, which makes it impossible for us to use this feature in a multi-user environment. If only a random selection of the cells are used as input to the width calculations the method could be considerably faster. I understand that this cannot be the default behaviour but optional methods to use when full accuracy is not required.

Thanks and best regards,
Ulf Ekström

Hi Ulf,

Could you please post your template files (the file that autofit not work and the large file that autofit runs slowly) here? Thank you.

Dear Karen,

We are not using any templates (most of the time). Our platform generates the files from scratch. Is that the reason why the autofitting is slow?

Thanks,
Ulf

Dear Ulf,

The first problem that autofit cause column width too large. Could you please try this: Generate a file with your scratch without apply the autofit method, then open your output file with Aspose.Cell for Java and call autofit method on it, and then, save the file and check if the column width is fit. If the column width is still not fit, please attatch the output file here. Otherwise, please paste your former scratch here and let me check if some method after autofit changes the columns’ width.

To the second problem. We are not sure why the autofit method runs so slowly on large files, but we will check if some optimize can be done on the autofit method. Could you please attach one of your output “large” file here and let us check the time cost.

Thank you.

Dear Karen,

I will continue this in a new thread so that I can keep the attachments private.

Regards,
Ulf