Edit report at https://pear.php.net/bugs/bug.php?id=18897&edit=1
ID: 18897
Updated by: daniel.oconnor@gmail.com
Reported By: patrick dot douret at axyus dot com
Summary: Excel format rotation angle
-Status: Open
+Status: Feedback
Type: Bug
Package: Spreadsheet_Excel_Writer
Operating System: Debian
Package Version: 0.9.2
PHP Version: 5.3.1
Roadmap Versions:
New Comment:
-Status: Open
+Status: Feedback
Can you fork & send in a pull request for this?
Previous Comments:
------------------------------------------------------------------------
[2011-10-10 14:05:52] pdouret
Description:
------------
When setting up a rotation for a cell format, rotation angle is never
taken into account.
Test script:
---------------
$workbook = & new Spreadsheet_Excel_Writer_Workbook($fname);
$workbook->setVersion(8);
$worksheet = & $workbook->addworksheet("MyWorkSheet");
$fHzTitre_1 = & $workbook->addformat(array('bold' => 1,
'color' => 'black',
'font' => 'Arial',
'size' => 10,
'align' => 'center',
//'align' => 'vcentre',
'border' => 1,
'textwrap'));
$fHzTitre_1->setTextRotation(30);
...
Expected result:
----------------
In my case, each cell having "fHzTitre_1" as format, should have a
rotation angle of 30°
Actual result:
--------------
No rotation
To get the rotation OK, I had to modify as follow function
"setTextRotation" of library "Format.php":
function setTextRotation($angle)
{
if($this->_BIFF_version == 0x0600) {
$this->_rotation = $angle;
} else {
switch ($angle) {
case 0:
$this->_rotation = 0;
break;
case 90:
$this->_rotation = 3;
break;
case 270:
$this->_rotation = 2;
break;
case -1:
$this->_rotation = 1;
break;
default :
return $this->raiseError("Invalid value
for angle.".
" Possible
values are: 0, 90, 270 and -1 ".
"for stacking
top-to-bottom.");
$this->_rotation = 0;
break;
}
}
}
------------------------------------------------------------------------