El codigo que tengo para generar mi excel es el siguiente:
Código PHP:
<?php
require_once 'clases/Writer.php';
$workbook = new Spreadsheet_Excel_Writer();
$worksheet =& $workbook->addWorksheet();
$worksheet->setLandscape();
// Merge cells from row 0, col 0 to row 2, col 2
$formatHeader =& $workbook->addFormat(array('Align' => 'center', 'Bold' => true, 'Size' => 12));
$formatDatosColegio =& $workbook->addFormat(array('Align' => 'center', 'Bold' => true, 'Size' => 10));
$formatTitle =& $workbook->addFormat(array('Align' => 'center', 'Size' => 12));
$formatNota =& $workbook->addFormat(array('Align' => 'center', 'Border' => 1, 'NumFormat' => '0.0'));
$formatNotaFinal =& $workbook->addFormat(array('Align' => 'center', 'Border' => 1, 'NumFormat' => '0.0', 'FgColor' => 55, 'Bold' => true));
$formatNotaFinal->setLocked();
$formatAutoIncremet =& $workbook->addFormat(array('Border' => 1));
$formatDocumento =& $workbook->addFormat(array('Border' => 1, 'Align' => 'right'));
$formatEstudiante =& $workbook->addFormat(array('Border' => 1));
/*Ancho de las columnas*/
$worksheet->setColumn(0, 0, 3);
$worksheet->setColumn(1, 1, 20);
$worksheet->setColumn(2, 2, 40);
$worksheet->setColumn(3, 17, 5);
$worksheet->writeString(0, 0, $_SESSION['infocol1'], $formatHeader);
$worksheet->mergeCells(0, 0, 0, 25);
$worksheet->writeString(1, 0, $_SESSION['infocol2'], $formatHeader);
$worksheet->mergeCells(1, 0, 1, 25);
$worksheet->writeString(2, 0, $_SESSION['nombcole'] . " - SEDE " . $_SESSION['nombsede'], $formatHeader);
$worksheet->mergeCells(2, 0, 2, 25);
$worksheet->writeString(3, 0, $_SESSION['resocole'], $formatDatosColegio);
$worksheet->mergeCells(3, 0, 3, 25);
$worksheet->writeString(4, 0, "DANE " . $_SESSION['danecole'] . " NIT " . $_SESSION['nnitcole'], $formatDatosColegio);
$worksheet->mergeCells(4, 0, 4, 25);
$worksheet->writeString(6, 0, "PLANILLA DE SEGUIMIENTO ACADEMICO Y CONVIVENCIA PARA DILIGENCIAR OFFLINE", $formatTitle);
$worksheet->mergeCells(6, 0, 6, 25);
foreach($datos as $dato):
$indiceFila = 14;
$i = 1;
foreach($dato['estudiantes'] as $estudiante):
$worksheet->write($indiceFila, 0, $i, $formatAutoIncremet);
$worksheet->write($indiceFila, 1, $estudiante['idenestu'], $formatDocumento);
$worksheet->write($indiceFila, 2, $estudiante['Estudiante'], $formatEstudiante);
$worksheet->write($indiceFila, 3, $estudiante['not1val1'], $formatNota);
$worksheet->write($indiceFila, 4, $estudiante['not2val1'], $formatNota);
$worksheet->write($indiceFila, 5, $estudiante['not3val1'], $formatNota);
$worksheet->write($indiceFila, 6, $estudiante['not4val1'], $formatNota);
$worksheet->write($indiceFila, 7, $estudiante['not5val1'], $formatNota);
$worksheet->write($indiceFila, 8, $estudiante['not6val1'], $formatNota);
$worksheet->write($indiceFila, 9, $estudiante['not7val1'], $formatNota);
$worksheet->write($indiceFila, 10, $estudiante['not8val1'], $formatNota);
$worksheet->write($indiceFila, 11, $estudiante['not9val1'], $formatNota);
$worksheet->write($indiceFila, 12, $estudiante['not0val1'], $formatNota);
$worksheet->writeFormula($indiceFila, 13, "=AVERAGE(D" . $indiceFila . ":M" . $indiceFila . ")", $formatNotaFinal);
$worksheet->writeNumber($indiceFila, 14, $estudiante['not1val2'], $formatNota);
$worksheet->writeNumber($indiceFila, 15, $estudiante['not2val2'], $formatNota);
$worksheet->writeNumber($indiceFila, 16, $estudiante['not3val2'], $formatNota);
$worksheet->writeFormula($indiceFila, 17, "=AVERAGE(O" . $indiceFila . ":Q" . $indiceFila . ")", $formatNotaFinal);
$worksheet->writeNumber($indiceFila, 18, $estudiante['not1val3'], $formatNota);
$worksheet->writeNumber($indiceFila, 19, $estudiante['not2val3'], $formatNota);
$worksheet->writeFormula($indiceFila, 20, "=AVERAGE(S" . $indiceFila . ":T" . $indiceFila . ")", $formatNotaFinal);
$i++;
$indiceFila++;
endforeach;
endforeach;
$workbook->send('planilla_calificaion_completa.xls');
$workbook->close();
Al ver que esto no me funciono busque otra clase la PHPExcel pero para hacer lo mismo que hago con Spreadsheet Excel Writer pues son muchas mas lineas de codigo...