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

When load in PhpSpreadsheet for cleared cell in Excel, applied from entire row style #3533

Closed
2 of 8 tasks
ngyuki opened this issue Apr 23, 2023 · 0 comments · Fixed by #3688
Closed
2 of 8 tasks

When load in PhpSpreadsheet for cleared cell in Excel, applied from entire row style #3533

ngyuki opened this issue Apr 23, 2023 · 0 comments · Fixed by #3688

Comments

@ngyuki
Copy link

ngyuki commented Apr 23, 2023

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?

Row style are not applied to cleared cell in Excel.

What is the current behavior?

Row style are applied to cleared cell in Excel.

What are the steps to reproduce?

  1. Apply background color to entire Row 1:1 in Excel
  2. Clear cell A1 in Excel (the background color of A1 is also cleared)
  3. Load and save the xlsx file with the following code
  4. In the saved xlsx file, the background color of A1 reverts back to before it was cleared
<?php

require __DIR__ . '/vendor/autoload.php';

use PhpOffice\PhpSpreadsheet\IOFactory;
$book = IOFactory::load(__DIR__ . '/input.xlsx');
IOFactory::createWriter($book, IOFactory::READER_XLSX)->save(__DIR__ . '/output.xlsx');

input.xlsx
output.xlsx

What features do you think are causing the issue

  • Reader
  • Writer
  • Styles
  • Data Validations
  • Formula Calculations
  • Charts
  • AutoFilter
  • Form Elements

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

XLSX (as far as I know)

Which versions of PhpSpreadsheet and PHP are affected?

php 8.2.2
phpoffice/phpspreadsheet 1.28.0 and master(e9cf273)

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

Successfully merging a pull request may close this issue.

1 participant