
April 4th, 2007, 02:52 PM
|
|
Contributing User
|
|
Join Date: Apr 2007
Posts: 5
Time spent in forums: 1 h 44 m 6 sec
Reputation Power: 0
|
|
|
Iterating over columns
Anybody see a problem with the way I'm triying to print these columns out using PEAR/Excel? $result is populated -- I made sure with print_r.
php Code:
Original
- php Code |
|
|
|
$rows = 0; $cols = 0; for ($col = 0; $col < $cols; $col++) { } // Add all the column headings with a single call $sheet->writeRow(5,0,$colNames,$colHeadingFormat); $colHeadingFormat2 =& $xls->addFormat(); $colHeadingFormat2->setFontFamily('Helvetica'); $colHeadingFormat2->setSize('10'); $colHeadingFormat2->setAlign('center'); for ($row = 0; $row < $rows; $row++) { for ($col = 0; $col < $cols; $col++) { $sheet->write($row+6,$col,$rs[$col],$colHeadingFormat2); } }
|