Skip to content

Combining the setAutoFilter and setAutoSize #2274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cwolcott opened this issue Aug 15, 2021 · 1 comment
Closed

Combining the setAutoFilter and setAutoSize #2274

cwolcott opened this issue Aug 15, 2021 · 1 comment

Comments

@cwolcott
Copy link

This is:

- [X] a bug report
- [ ] a feature request

What is the expected behavior?

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
AutoFilter AutoSize NotCalculated

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

Which versions of PhpSpreadsheet and PHP are affected?

version 1.18.0 and master branch

@cwolcott cwolcott changed the title Combining the setAutoFilter and Autosize Combining the setAutoFilter and setAutoSize Aug 15, 2021
@cwolcott
Copy link
Author

cwolcott commented Nov 6, 2021

This has been fixed in issue #2273

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant