PHP_XLSXWriter
PHP_XLSXWriter copied to clipboard
RTL formatting
couldn't find any reference to RTL formatting of a spreadsheet. is it possible, any support for this option? in PHPexcel it will look like this: $objPHPExcel->getActiveSheet()->setRightToLeft(true);
thank you.
It supports UTF8, but there is no current way to set a RightToLeft flag. I'm not sure if a RightToLeft flag is necessary in the xlsx format or not.. I'll have to look into it more.
A simple solution if you need all your spreadsheets to be RTL.
Change : rightToLeft="false"
to rightToLeft="true"
on line: 154
The longer solution is to add this function to the class (after line 47)
public function setRightToLeft($rightToLeft='false') { $this->rightToLeft=$rightToLeft; }
and then change line 154 (should be 155 now) to:
$sheet->file_writer->write( '<sheetView colorId="64" defaultGridColor="true" rightToLeft="'.$this->rightToLeft.'" showFormulas="false" showGridLines="true" showOutlineSymbols="true" showRowColHeaders="true" showZeros="true" tabSelected="' . $tabselected . '" topLeftCell="A1" view="normal" windowProtection="false" workbookViewId="0" zoomScale="100" zoomScaleNormal="100" zoomScalePageLayoutView="100">');
and then you can set:
$writer->setRightToLeft('true');
on each file.
I'm not sure how to do this for each separate sheet
added in https://github.com/mk-j/PHP_XLSXWriter/commit/39101b730210faae9dc47260a207a0823d6d7479