Skip to content
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

Hidden columns are not respected in XML format #3566

Closed
SlowFox71 opened this issue May 13, 2023 · 1 comment · Fixed by #3567
Closed

Hidden columns are not respected in XML format #3566

SlowFox71 opened this issue May 13, 2023 · 1 comment · Fixed by #3567

Comments

@SlowFox71
Copy link

This is:

- [ ?] a bug report
- [ X] a feature request
- [ X] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

If an XML-File is imported columns and Rows with ss:Hidden="1" should be hidden.

What is the current behavior?

Those columns are visible (because no code path exists to process the Hidden attribute). I am unsure whether this qualifies as a bug or as a missing feature.

What are the steps to reproduce?

Use the attached file (github refuses to upload xml, so I declared it as plain text).

What features do you think are causing the issue

  • [ X] Reader

Does an issue affect all spreadsheet file formats? If not, which formats are affected?

Only XML is affected.

Which versions of PhpSpreadsheet and PHP are affected?

All versions are affected.

The patch to fix this is only 8 lines; I created a fork, but as I have no experience with the whole tool chain (not github, not composer, not unit testing) I refrain from converting it into a pull request.
test.txt

oleibman added a commit to oleibman/PhpSpreadsheet that referenced this issue May 14, 2023
Fix PHPOffice#3566; PhpSpreadsheet should now handle Hidden attribute for rows and columns in Xml spreadsheets. Also added the ability to load Xml spreadsheet from string rather than file, as can be done for Csv and Html.
@oleibman
Copy link
Collaborator

Closing this issue. Discussion continues in 3568.

oleibman added a commit that referenced this issue May 18, 2023
…eadsheet (#3567)

* Recognize 'Hidden' Attribute in Xml Spreadsheet

Fix #3566; PhpSpreadsheet should now handle Hidden attribute for rows and columns in Xml spreadsheets. Also added the ability to load Xml spreadsheet from string rather than file, as can be done for Csv and Html.

* Add Support for Top Left Cell

Another missing piece.

* Font Bold/Italic

Was always setting to true rather than checking value for 0/1.

* Active Sheet Index

Had always been set to hard-coded 0. Read it from XML if available.

* Selected Cells

Get Selected Cells from XML when available.

* Worksheet Protection and Style Protection

Add support for those to Xml Reader.

* Column Spans

Not really an essential part of Excel, used in Xml to reduce file size.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants