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)
changed columns/rows dimensions in ODS
autoSize and setWidth/SetROwHeight does work in PhpSpreadsheet, but Ods writer ignores them
<?php
require 'vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\IOFactory,
PhpOffice\PhpSpreadsheet\Spreadsheet;
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->getCell("A1")->setValue("test");
$sheet->getColumnDimension('A')->setWidth(20.0);
$sheet->getRowDimension(1)->setRowHeight(50.0);
IOFactory::createWriter($spreadsheet, "Ods")->save("test.ods"); // width, heigh are default
IOFactory::createWriter($spreadsheet, "Xlsx")->save("test.xlsx"); // width, height are as expected
composer "phpoffice/phpspreadsheet": "dev-master" , 1.11.0
PHP 7.2.24
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.
I'm experiencing the same bug
I have the same bug.
The thing I finally did is to use only .xlsx export and open it with LibreOffice, gives better results
My project requires exporting .ods.
The ods writer is missing a lot of format support, like border, alignment, font size, etc.
My solution is using libreoffice to convert .xlsx to .ods.
The command used for converting is
soffice --headless --convert-to ods example.xlsx
The output will be example.ods
Ah, nice trick !
This bug is still present in 1.17.1.
Just ran into this issue. Issue seems to need reopening.