Bug #4292 [Opn->Csd]: setPattern sample code is misleading

From: Date: Fri, 06 May 2005 14:26:08 +0000
Subject: Bug #4292 [Opn->Csd]: setPattern sample code is misleading
References: 1  Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-5988@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=4292&edit=1 ID: 4292 Updated by: didou@keliglia.com Reported By: davidjames77 at yahoo dot com -Status: Open +Status: Closed Type: Bug Package: Documentation PHP Version: Irrelevant New Comment: This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better. I didn't see the example you're mentioning but the real example had that error too : // green in different patterns $another_format1 =& $workbook->addFormat(); $another_format1->setBgColor('green'); $another_format1->setPattern($i); $worksheet->write(1, $i, "another pattern", $another_format1); // red in different patterns $another_format2 =& $workbook->addFormat(); $another_format2->setFgColor('red'); $another_format2->setPattern($i); $worksheet->write(1, $i, "another pattern", $another_format2); // mixed red and green according to pattern $another_format3 =& $workbook->addFormat(); $another_format3->setBgColor('green'); $another_format3->setFgColor('red'); $another_format3->setPattern($i); $worksheet->write(1, $i, "another pattern", $another_format3); Thank you for your feedback ! Previous Comments: ------------------------------------------------------------------------ [2005-05-05 18:42:05] davidjames77 at yahoo dot com Description: ------------ The sample code for Format::setPattern http://pear.php.net/manual/en/package.fileformats.spreadsheet-excel-writer.spreadsheet-excel-writer-format.setpattern.php has a few mistakes. Could use a small change to these three lines: $worksheet->write(1, $i, "another pattern", $another_format1); $worksheet->write(1, $i, "another pattern", $another_format2); $worksheet->write(1, $i, "another pattern", $another_format3); I recommend they be changed to: $worksheet->write(1, $i, "bg=r", $another_format1); $worksheet->write(2, $i, "fg=r", $another_format2); $worksheet->write(3, $i, "fg=r,bg=g", $another_format3); That way, you actually get three lines of output. And you can easily see which examples are which by the bg= and gb= text. Reproduce code: --------------- See source code example on http://pear.php.net/manual/en/package.fileformats.spreadsheet-excel-writer.spreadsheet-excel-writer-format.setpattern.php ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=4292&edit=1

« previous php.pear.doc (#5988) next »