call to undefined method issue
| From: | Tom Synnott | Date: | Mon, 25 Jun 2007 22:52:20 +0000 |
| Subject: | call to undefined method issue | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-27570@lists.php.net to get a copy of this message | ||
I thought I'd figured out how to format all the cells in one go but when I run the script it loads 'call to undefined method' into the Excel file... Any ideas anyone?
// Send HTTP headers to tell the browser what's coming
$xls->send("test.xls");
// Add a worksheet to the file, returning an object to add data to
$sheet =& $xls->addWorksheet('Binary Count');
$format =& $sheet->addFormat(array('right' => 5, 'top' => 5, 'size' => 15,
'pattern' => 1, 'bordercolor' => 'blue',
'fgcolor' => 'red'));
$query = "SELECT * FROM$sheet->getName("Meber Status");tblmembersWHEREMember='A' ORDER BY LastName"; $result = mysql_query($query); $num = mysql_num_rows($result); $i=1; $bold =& $xls->addFormat(); $bold->setBold(1);
$sheet->write(0,0,"First Name",$bold);$sheet->write(0,1,"Last Name",$bold); $sheet->write(0,2,"Date Of Birth",$bold); $sheet->write(0,3,"Mobile",$bold);
while ($row = mysql_fetch_array($result)) {
$sheet->setColumn(0, 0, 30);
$sheet->write($i,0,"{$row['FirstName']}", $format);
$sheet->write($i,1,"{$row['LastName']}");
$sheet->write($i,2,"{$row['DateOfBirth']}");
$sheet->write($i,3,"{$row['MobileNumber']}");
$i++;
}
Cheers!