Skip to content

Change cell read order to RTL not working #850

@mansourcodes

Description

@mansourcodes

This is:

- [ ] a bug report

What is the expected behavior?

Change cell read order to RTL

What is the current behavior?

read order still to context (not changed)

What are the steps to reproduce?

<?php

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

use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Spreadsheet;


// Create new Spreadsheet object
$spreadsheet = new Spreadsheet();


// Add some data
$spreadsheet->setActiveSheetIndex(0)
    ->setCellValue('A1', '1-'.'منصور حسين الناصر');


$styleArray = [
    'alignment' => [
        'readorder' => \PhpOffice\PhpSpreadsheet\Style\Alignment::READORDER_RTL,
    ],

];

$spreadsheet->getActiveSheet()->getStyle('A1')->applyFromArray($styleArray);



// Redirect output to a client’s web browser (Xls)
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="01simple.xls"');
header('Cache-Control: max-age=0');

$writer = IOFactory::createWriter($spreadsheet, 'Xls');
$writer->save('php://output');
exit;

Which versions of PhpSpreadsheet and PHP are affected?

Latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions