-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Description
This is:
- [X] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
What is the expected behavior?
I initially reported this in #2274, but then prematurely closed it when I thought it was fixed.
I would have hoped that using the setAutoSize function would have appropriately determined the correct size for a column when the function setAutoFilter had already be applied.
Font::setTrueTypeFontPath("/usr/share/fonts/msttcore/");
Font::setAutoSizeMethod(Font::AUTOSIZE_METHOD_EXACT);
...
// Apply filtering capability to the worksheet
$worksheet->setAutoFilter($worksheet->calculateWorksheetDimension());
// Apply auto size to all columns
foreach (range('A',$workSheetMaxColumns) as $col) { $worksheet->getColumnDimension($col)->setAutoSize(true); }
...What is the current behavior?
It does not seem to take into account the filter icon shown in the column. See attached images

When I double click on the column seperator in excel it widens the column widths to my satisfaction.

Which versions of PhpSpreadsheet and PHP are affected?
version 1.18.0+
I thought this was fixed, but I guess I fixed it myself and then lost the fix when upgrading from 1.18.0 to 1.20.0. I am trying to figure out what I did to fix it.
Before in 1.18.0 with may fix:

After in 1.20.0 after losing my fix:

You can see that the columns are not taking in account the filter icon.