-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Reader\Xlsx - showGridlines option is set when shouldn't #912
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Reopening. It seems a bit odd, but legitimate. Expect a fix in a day or two. |
oleibman
added a commit
to oleibman/PhpSpreadsheet
that referenced
this issue
Jul 17, 2024
Fix PHPOffice#912, opened in Feb. 2019, and closed as stale in Apr. 2019, and which I have re-opened to be closed properly by this PR. Another "better late than never". Original issue says that print options should not affect ShowGridlines, which seems true enough. Aside from that, the existing code isn't quite correct anyhow. Excel looks for 2 attributes, one of which must be explicitly set to true and the other of which must not be explicitly set to false, in order to determine whether PrintGridlines should be set. PhpSpreadsheet is changed to do the same. This could be treated as a BC break for the unusual situation described in the issue, but it seems more like a bug fix to me.
11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is:
What is the expected behavior?
when reading - do not set xml attribute showGridlines from element sheetView to true when xml attribute gridlinesSet from element printOptions is true
What is the current behavior?
when reading - xml attribute showGridlines from element sheetView is set to true when xml attribute gridlinesSet from element printOptions is true
What are the steps to reproduce?
Just read any xlsx file saved in a way that has gridlines invisible for sheetView (showGridLines="false") and contains printOptions element with attribute gridLinesSet="true"
e.g. in sheet1.xml
after reading this file, the result created with phpspreadsheet will allways have showGridLines="true" in sheetView
and it is because of this part of code in reader (mainly the first "if" block) https://github.com/PHPOffice/PhpSpreadsheet/blob/1.6.0/src/PhpSpreadsheet/Reader/Xlsx.php#L880-L885
and according to some specification i've found, the code highlighted should change into this:
Which versions of PhpSpreadsheet and PHP are affected?
phpspreadsheet 1.6.0
any php version
Specification that i've found can be downloaded here https://www.iso.org/standard/71691.html
and contains
so nothing about sheetView, but only about printing
The text was updated successfully, but these errors were encountered: