php - phpexcel not writing data to excel file using setCellValueByColumnAndRow -


$objphpexcel = phpexcel_iofactory::load("untitled.xls");  foreach ($objphpexcel->getworksheetiterator() $worksheet) //loop through 3 worksheets of kindleeditioneisbn { $sheet_name = $worksheet->gettitle();    if ($worksheet->gettitle = 'records') { $highestcolumm = $objphpexcel->setactivesheetindex(0)->gethighestcolumn(); $highestrow = $objphpexcel->setactivesheetindex(0)->gethighestrow(); $objphpexcel->getactivesheet()->setcellvaluebycolumnandrow($highestcolumm, $highestrow, $node_10);  $objwriter2007 = phpexcel_iofactory::createwriter($objphpexcel, 'excel2007'); $objwriter2007->save('php://output'); 

the above code, run , if loop works because getting output not in "untitled.xls" file

this code won't write untitled.xls because you're saving php://output (the screen) content of file should displayed on screen unless you're sending headers tell browser treat output excel file; , you're using excel2007 writer generate output officeopenxml format xlsx file rather biff format xls file.

so seeing output on screen?


Comments

Popular posts from this blog

Java sticky instances of class com.mysql.jdbc.Field aggregating -