PHP_XLSXWriter icon indicating copy to clipboard operation
PHP_XLSXWriter copied to clipboard

RTL formatting

Open rootstock-eran opened this issue 8 years ago • 3 comments

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.

rootstock-eran avatar Jul 31 '16 08:07 rootstock-eran

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.

mk-j avatar Feb 01 '17 04:02 mk-j

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

galzil avatar Feb 28 '18 07:02 galzil

added in https://github.com/mk-j/PHP_XLSXWriter/commit/39101b730210faae9dc47260a207a0823d6d7479

mk-j avatar Nov 07 '19 16:11 mk-j