-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Open
Description
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
Labels
No labels