I’ve just upgraded aspose-cells from 8.8.3 to 17.4.0, and have found that the autoFitColumns has broke when the cells contain text with line breaks. The following will not auto fit very well:
String s = “line1 \r\n line2”;
We see that the column will fit to the size of the entire text in one line, but do the line breaks on the final sheet. This results in some very wide columns with double width.
I have tested your scenario/case a bit. I used the following sample code for it. I found that the AutoFit Columns operation does not fit the second column (which has wrapped text) correctly. When I auto-fit the second column in MS Excel manually, it sets the column’s width (minimizes it) currently.
I have attached the output file for your reference. Could you check and confirm if this is the issue, you are talking about or something else? After your confirmation, I will log a ticket for it accordingly so nothing should be missed. If you are talking about some other issue, kindly do paste your sample code with template file(s), we will check it soon.
As I observed the issue as you mentioned by using the following sample code.The Worksheet.autoFitColumns() does not work well with the cells having line breaks. I also tested it with v8.8.3, it works as expected: e.g Sample code:
This is to inform you that we have fixed your issue now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.
Once the fix is available for public use, we will share the Download link here.
We are afraid, whenever the last digit in the version number is non-zero, it is considered as hot fix and if it is zero, it is considered as release, only releases are available via Maven.
Please wait for our next release i.e. 17.5.0, which will include this fix as well and it will also be available via Maven.
FYI: The next release will be delivered somewhere between 15-25th May, 2017.
Good to know that your issue is sorted out by the new fix. Feel free to contact us any time if you have further comments or questions, we will be happy to assist you soon.