You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [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?
Column width calculated with setAutoSize should work well with tables.
What is the current behavior?
It does not seem to take into account the filter icon shown in the column added by default when using a table.
I'm assuming this is beacause there is a check in Font::calculateColumnWidth() when you use setAutoSize to see if you have any filter and adjust if necessary but it don't look for tables AutoFilter.
Yes, previously with AutoFilter, it was only possible to have a single AutoFilter per Worksheet. But now as Tables can have their own AutoFilter, it's possible to have multiple AutoFilter ranges per Worksheet; and I'd forgotten about handling AutoFit for Tables. The same issue will also apply when I eventually add support for Pivot Tables.
It isn't so easy to add this to the existing code for calculating a column width based on its content; so I'll probably need to do some refactoring of that part of the codebase, and that means it won't be as quick to resolve as I'd like.
I still have problems with using setAutoSize where the columns are sometimes too small and other times they are too large. I assume that it is impossible to get this exact without recreating the logic that Excel uses (or any other application for that matter). Is that correct?
This is:
What is the expected behavior?
Column width calculated with setAutoSize should work well with tables.
What is the current behavior?
It does not seem to take into account the filter icon shown in the column added by default when using a table.
I'm assuming this is beacause there is a check in Font::calculateColumnWidth() when you use setAutoSize to see if you have any filter and adjust if necessary but it don't look for tables AutoFilter.
What are the steps to reproduce?
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
What features do you think are causing the issue
Which versions of PhpSpreadsheet and PHP are affected?
PhpSpreadsheet 1.27.1
PHP 8.1.4
(Xlsx writer)
The text was updated successfully, but these errors were encountered: