PHP_XLSXWriter icon indicating copy to clipboard operation
PHP_XLSXWriter copied to clipboard

Text Rotation

Open DrJaymz opened this issue 6 years ago • 2 comments

Hi, I couldn't determine how to rotate text. I have a spreadsheet like I want it and looking at styles XML it has <alignment textRotation="90"/>

I've skimmed the source and can see these flags hardcoded in a couple of places but I cannot determine if I can add it via the provided methods without altering the source. Maybe its obvious and I just need more coffee?

DrJaymz avatar Aug 15 '18 07:08 DrJaymz

Hi, have you find a solution. I'm looking for too.

cseoneohs avatar Apr 01 '20 07:04 cseoneohs

open xlsxwriter.class.php and add this rows:

  1. line 586 after $textRotation = isset($v['text_rotation']) ? $v['text_rotation'] : '0';
  2. line 596 change $file->write(' <alignment horizontal="'.$horizAlignment.'" vertical="'.$vertAlignment.'"textRotation="'.$textRotation.'" wrapText="'.$wrapText.'" indent="0" shrinkToFit="false"/>');
  3. find isset($style['wrap_text'] and after add : if (isset($style['text_rotation'])) { $style_indexes[$i]['text_rotation'] = $style['text_rotation']; }

example use : $row_options = array('text_rotation'=>'90')

mehmeth86 avatar Mar 17 '21 22:03 mehmeth86