We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This is:
Merged cells should work in Ods format
Merged cells do not work in Ods format
Test code provided, creates and tests files in all merge-supported formats, only Ods fails. This can be added to tests.
<?php require __DIR__ . '/vendor/autoload.php'; ////////////////////////////////////////////////////////// // example with merged cells: $spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); $spreadsheet->setActiveSheetIndex(0); $spreadsheet->getActiveSheet()->setCellValue('A1', '1'); $spreadsheet->getActiveSheet()->setCellValue('B1', '2'); $spreadsheet->getActiveSheet()->setCellValue('A2', '33'); $spreadsheet->getActiveSheet()->mergeCells('A2:B2'); ////////////////////////////////////////////////////////// // Write in all merge-supported formats: $Formats = array('Html','Xls','Xlsx','Ods'); foreach( $Formats as $Format) { // create test file: $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, $Format); $file = "merge.".strtolower($Format); $writer->save($file); // now test: if( 1 != calculate_merged_cells($file,$Format) ) die("Format $Format failed, no merged cells found!\n"); } function calculate_merged_cells($file,$Format) { $reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($Format); $spreadsheet = $reader->load($file); $n = 0; foreach ($spreadsheet->getWorksheetIterator() as $worksheet) { foreach ($worksheet->getMergeCells() as $cells) { var_dump($cells); $n++; } } return $n; }
all including latest development version
The text was updated successfully, but these errors were encountered:
96f3f66
Support to write merged cells in ODS format
9d627b8
Fixes PHPOffice#287
No branches or pull requests
This is:
What is the expected behavior?
Merged cells should work in Ods format
What is the current behavior?
Merged cells do not work in Ods format
What are the steps to reproduce?
Test code provided, creates and tests files in all merge-supported formats, only Ods fails.
This can be added to tests.
Which versions of PhpSpreadsheet and PHP are affected?
all including latest development version
The text was updated successfully, but these errors were encountered: