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

Error on export xlsx when DataValidation #2395

Closed
ghost opened this issue Nov 11, 2021 · 1 comment
Closed

Error on export xlsx when DataValidation #2395

ghost opened this issue Nov 11, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Nov 11, 2021

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?

image

What is the current behavior?

image

What are the steps to reproduce?

$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet = $spreadsheet->getSheet(0);
$validation = $sheet->getCell('B2')->getDataValidation();
$validation->setType(\PhpOffice\PhpSpreadsheet\Cell\DataValidation::TYPE_LIST);
$validation->setFormula1('"A, B, C, D"');
$validation->setError('Select one from the drop down list.');

$writer = new Xlsx($spreadsheet);
$name = str_replace('.','',str_replace(' ', '',microtime().date('Y h'))).'.xlsx';
$path = 'arquivos/modelo_planilha/'.$name;
$writer->save($path);

Which versions of PhpSpreadsheet and PHP are affected?

PHP: 7.3
PhpSpreadsheet : 1.19

@oleibman
Copy link
Collaborator

Closed as duplicate of #2368, for which there are as-yet-unmerged PRs which you might be able to test.

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