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

Request #5806 XLS formatage des header automatique
Submitted: 2005-10-28 10:02 UTC
From: vv43 Assigned: olivierg
Status: Closed Package: Structures_DataGrid
PHP Version: 4.4.1 OS:
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 32 - 25 = ?

 
 [2005-10-28 10:02 UTC] vv43
Description: ------------ Structures_Datagrid_Renderer_XLS::_buildHeader() Ajout d'une coloration du header, ainsi que du freeze du header Super boulot en tout cas :) Test script: --------------- function _buildHeader() { $cnt = 0; $this->_worksheet->freezePanes(array(1,0,1,1)); $formate =& $this->_workbook->addFormat(); $formate->setSize(10); $formate->setAlign('center'); $formate->setColor('black'); $formate->setPattern(); $formate->setFgColor('darkgray'); foreach ($this->_dg->columnSet as $column) { //Define Content $str = $column->columnName; $this->_worksheet->write(0, $cnt, $str, $formate); $cnt++; } }

Comments

 [2005-10-28 14:12 UTC] olivierg at php dot net
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. I have modified the XLS renderer to allow such customizations (among many others). You can now provide custom Excel Writer and Format objects. Example : $workbook = new Spreadsheet_Excel_Writer(); $workbook->send('test.xls'); $worksheet =& $workbook->addWorksheet(); $renderer =& $datagrid->getRenderer(); $renderer->setCustomWriter ($workbook, $worksheet); $headerFormat =& $workbook->addFormat(); $headerFormat->setSize(10); $headerFormat->setAlign('center'); $headerFormat->setColor('black'); $headerFormat->setPattern(); $headerFormat->setFgColor('darkgray'); $renderer->setHeaderFormat ($headerFormat); $bodyFormat =& $workbook->addFormat(); $bodyFormat->setColor('red'); $renderer->setBodyFormat ($bodyFormat); $datagrid->render();