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

No alignment handling in ods writer #1796

Closed
knulo opened this issue Jan 15, 2021 · 1 comment
Closed

No alignment handling in ods writer #1796

knulo opened this issue Jan 15, 2021 · 1 comment
Labels
writer/ods Writer for Open/LibreOffice spreadsheet files (OASIS)

Comments

@knulo
Copy link

knulo commented Jan 15, 2021

This is:

- [x] a bug report
- [ ] a feature request
- [x] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

Assigned alignment to cells are written to ods file.

What is the current behavior?

Assigned alignments are ignored.

What are the steps to reproduce?

Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:

<?php

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

// Create new Spreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();

// add code that show the issue here...
$sheet = $spreadsheet->setActiveSheetIndex(0);
$sheet->getCell('A1', true)->setValue('XXXXXXXXXX');
$sheet->getCell('A2', true)->setValue('X');
$sheet->getStyle('A2')->getAlignment()
	->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::CreateWriter($spreadsheet, 'Ods');
$writer->save('buggy.ods');

Which versions of PhpSpreadsheet and PHP are affected?

current - installed on January 11th

Solution

see: #1795

@MarkBaker MarkBaker added the writer/ods Writer for Open/LibreOffice spreadsheet files (OASIS) label Apr 26, 2022
@MarkBaker
Copy link
Member

Added in release 1.17.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
writer/ods Writer for Open/LibreOffice spreadsheet files (OASIS)
Development

No branches or pull requests

2 participants