Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.9.4

Bug #8701 Problems with the method setTextRotation()
Submitted: 2006-09-14 15:26 UTC
From: mjansen at databay dot de Assigned: progi1984
Status: Closed Package: Spreadsheet_Excel_Writer
PHP Version: 4.3.1 OS: Linux/SuSE
Roadmaps: (Not assigned)    
Subscription  


 [2006-09-14 15:26 UTC] mjansen at databay dot de (Michael)
Description: ------------ If I use the method setVersion(8) to merge some cells with the experimental method mergeCells(), the text rotating in these merged cells does not work anymore. Test script: --------------- require_once("Spreadsheet/Excel/Writer.php"); $this->workbook = new Spreadsheet_Excel_Writer(); $this->workbook->setVersion(8); $this->worksheet =& $this->workbook->addWorksheet('xyz'); $this->format =& $this->workbook->addFormat(array('TextRotation'=>270, 'Align' => 'center', 'Top' => 1, 'Right' => 1, 'Bottom' => 1, 'Left' => 1)); $this->worksheet->write(0, 0, "abc123", $this->format); $this->worksheet->mergeCells(0,0,10,10); $this->workbook->close(); Expected result: ---------------- I expect, that the text appears in the horizontal center of the merged cells, with a border (left, right, bottom and top), rotated 270 degree.

Comments

 [2007-09-08 15:05 UTC] dr0bz (Hermann Bier)
I confirm this bug. I need to use setVersion(8) to be able to set the UTF-8 with setEncoding("utf8"). So using setTextRotate() in this case doesn't affect anything.
 [2008-08-27 06:53 UTC] momobil (Manu Robledo)
After some research I found a solution (patch) for this problem: I am not familiar with providing a patch, but just wanted to share the code, for if anyone needs it: There is the following line inside Format.php, method getXf($style): $rotation = 0x00; (in my version it is on line 432) If you replace this line with the following code it should work: switch($this->_rotation){ case 0: $rotation = 0; break; case 1: $rotation = 255; break; case 2: $rotation = 90; break; case 3: $rotation = 180; break; default: $rotation = 0; break; }
 [2009-08-05 18:22 UTC] progi1984 (Franck Lefevre)
The following patch has been added/updated: Patch Name: Bug8701 Revision: 1249478543 URL: http://pear.php.net/bugs/patch-display.php?bug=8701&patch=Bug8701&revision=1249478543&display=1
 [2009-08-05 18:23 UTC] progi1984 (Franck Lefevre)
-Status: Open +Status: Verified -Assigned To: +Assigned To: progi1984
The patch Bug8701 contains the text rotation for biff5 et biff8. Not only Biff8 like momobil.
 [2009-08-08 13:06 UTC] cweiske (Christian Weiske)
The patch introduces tabs instead of spaces which are not allowed according to our coding standards - please fix that.
 [2009-08-10 14:30 UTC] progi1984 (Franck Lefevre)
The following patch has been added/updated: Patch Name: Bug8701.patch Revision: 1249896652 URL: http://pear.php.net/bugs/patch-display.php?bug=8701&patch=Bug8701.patch&revision=1249896652&display=1
 [2009-08-11 23:26 UTC] cweiske (Christian Weiske)
-Status: Verified +Status: Closed
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.