PHP_XLSXWriter
PHP_XLSXWriter copied to clipboard
Text Rotation
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?
Hi, have you find a solution. I'm looking for too.
open xlsxwriter.class.php and add this rows:
- line 586 after
$textRotation = isset($v['text_rotation']) ? $v['text_rotation'] : '0';
- line 596 change
$file->write(' <alignment horizontal="'.$horizAlignment.'" vertical="'.$vertAlignment.'"textRotation="'.$textRotation.'" wrapText="'.$wrapText.'" indent="0" shrinkToFit="false"/>');
- 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')