babusek Posted September 16, 2009 Share Posted September 16, 2009 HI guys, i am using 'Spreadsheet excel writer' to write form data into an excel sheet. below is my code snippet, uses to add worksheets, iam getting an error, which is really breaking me. can u plz have a look at this, and help me. <?php $xml = simplexml_load_file("featureDetail.xml"); require_once 'Spreadsheet/Excel/Writer.php'; $excel = new Spreadsheet_Excel_Writer(); $sheet =& $excel->addWorksheet('Home'); $sheet->setColumn(0,0,29); foreach($xml->FEATURE as $feature) { global $excel; $value=html_entity_decode($feature->NAME); echo " Value = $value"; echo "<br>"; $sheet123 =& $excel->addWorksheet('$value'); $sheet123->setColumn(0,0,29); } foreach($xml->FEATURE as $feature) { $sheet =& $excel->addWorksheet(html_entity_decode($feature->NAME)); $sheet->setColumn(0,0,29); } ?> :'( Fatal error: Call to undefined method PEAR_Error::setColumn() in D:\xampp\htdocs\Release9.0\example.php on line 14 Quote Link to comment Share on other sites More sharing options...
callumd Posted August 2, 2010 Share Posted August 2, 2010 For those who stumble upon this thread in a Google search (like I did), I was able to solve the problem by using short titles for my worksheets, eg: $worksheet =& $workbook->addWorksheet('some really really really really really long title'); Is baaaad. Shorten the title. Quote Link to comment Share on other sites More sharing options...
aristotle15 Posted January 31, 2011 Share Posted January 31, 2011 U can resolve this problem by removing the worksheet name in addworksheet() function because two sheets cannot have the same name... that throws the PEAR_error Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.