In using PHP to output an Excel file, it is working fine, however, each Excel file has 3 blank rows at the top. The headers are such:
<?php
header ("Expires: Mon, 28 Oct 2008 05:00:00 GMT");
header ("Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");
header ("Content-type: application/vnd.ms-excel");
header ("Content-Disposition: attachment; filename=\"GridExport.xls" );
header ("Content-Description: Generated Report" );
echo $content_for_layout;
?>
In looking at the 3 blank rows in a text editor such as notepad, I actually see one blank row, following by a row with a single space, following by another blank row, so that is basically equivalent to:
\n.\n\n
where the period = single space.
Finally, when I do open the file in Excel > 2003, I get this error message about the file not being in the right format, yet clicking yes opens it fine (minus the 3 blank row problem). Is it possible to send the right headers to not get this message? See a screenshot at:
https://twiki.auscope.org/wiki/pub/Grid/WfsReaderWs/OpenFileWarning.png