title: PHPExcel Header Line covering first entry
body: <p>Okay, next PHPExcel question. I have an HTML form that users fill out and the data will be sent to a database. All this works with no problems. I am using PHPExcel to send that information to an Excel worksheet so the President of the organization can view reports that have been sent in (he chose that he wanted it in Excel). When he clicks the button, the information is downloaded to Excel. This all works fine, except for the first line of the worksheet is covered by the Header information. I know that it is the header, because if I change $headings and delete value(s) in the array, part(s) of the hidden query then shows.</p>
  
  <p>I got this code from: <a href="http://phpexcel.codeplex.com/discussions/246121/" rel="nofollow">http://phpexcel.codeplex.com/discussions/246121/</a></p>
  
  <p>There may be a coding error, or I may not have uploaded all the files and classes to the internet...</p>
  
  <p>Any help is appreciated. Thanks.</p>
  
  <pre><code>// connection with the database 
  $dbhost = "I removed this for privacy"; 
  $dbuser = "I removed this for privacy"; 
  $dbpass = "I removed this for privacy"; 
  $dbname = "I removed this for privacy"; 
  
  mysql_connect($dbhost,$dbuser,$dbpass); 
  mysql_select_db($dbname); 
  
  // require the PHPExcel file 
  require 'Classes/PHPExcel.php'; 
  
  // simple query 
  
  $query = "
  
  SELECT dueDate, reporterName, program, noReportReason, recentActivity, impacted, fundsGenerated, fundsSpent, volunteers, input, potentialContacts, potentialSources
  FROM reports
  ORDER BY id
  
  "; 
  
  if ($result = mysql_query($query) or die(mysql_error())) 
  {   
  // Create a new PHPExcel object 
  $objPHPExcel = new PHPExcel(); 
  $objPHPExcel-&gt;getActiveSheet()-&gt;setTitle('Quarterly Project Reports'); 
  
  // Loop through the result set 
  $rowNumber = 1; 
  while ($row = mysql_fetch_row($result)) 
  { 
  $col = 'A'; 
  foreach($row as $cell) 
  { 
  $objPHPExcel-&gt;getActiveSheet()-&gt;setCellValue($col.$rowNumber,$cell); 
  $col++; 
  } 
  $rowNumber++; 
  }
  
  $rowNumber = 1;
  $headings = array('Due Date','Reporter Name','Name of Program','No Report This Quarter',
      'Recent Activity','Number of People Impacted','Funds Generated',
      'Funds Spent and Fuding Sources','Volunteers Mobilized','WNP Input',
      'Potential Contacts','Potential Sources'); 
  $objPHPExcel-&gt;getActiveSheet()-&gt;fromArray(array($headings),NULL,'A'.$rowNumber);  
  
  $rowNumber++; 
  // Loop through the result set 
  while ($row = mysql_fetch_row($result)) 
  {
  $col = 'A';
  foreach($row as $cell) 
  {
  $objPHPExcel-&gt;getActiveSheet()-&gt;setCellValue($col.$rowNumber,$cell);
  $col++;
  }
  $rowNumber++; 
  }
  
  //bold Header row
  $objPHPExcel-&gt;getActiveSheet()-&gt;getStyle('A1:L1')-&gt;getFont()-&gt;setBold(true); 
  
  //wrap column D
  $objPHPExcel-&gt;getActiveSheet()-&gt;getStyle('D1:D'.$objPHPExcel-&gt;getActiveSheet()-&gt;getHighestRow())-&gt;getAlignment()-&gt;setWrapText(true);
  
  //wrap column E
  $objPHPExcel-&gt;getActiveSheet()-&gt;getStyle('E1:E'.$objPHPExcel-&gt;getActiveSheet()-&gt;getHighestRow())-&gt;getAlignment()-&gt;setWrapText(true); 
  
  //set header row height
  $objPHPExcel-&gt;getActiveSheet()-&gt;getRowDimension('1')-&gt;setRowHeight(20);
  
  //set column widths
  $objPHPExcel-&gt;getActiveSheet()-&gt;getColumnDimension('A')-&gt;setWidth(15);
  $objPHPExcel-&gt;getActiveSheet()-&gt;getColumnDimension('B')-&gt;setWidth(20);
  $objPHPExcel-&gt;getActiveSheet()-&gt;getColumnDimension('C')-&gt;setWidth(30);
  $objPHPExcel-&gt;getActiveSheet()-&gt;getColumnDimension('D')-&gt;setWidth(50);
  $objPHPExcel-&gt;getActiveSheet()-&gt;getColumnDimension('E')-&gt;setWidth(50);
  $objPHPExcel-&gt;getActiveSheet()-&gt;getColumnDimension('F')-&gt;setWidth(30);
  $objPHPExcel-&gt;getActiveSheet()-&gt;getColumnDimension('G')-&gt;setWidth(30);
  $objPHPExcel-&gt;getActiveSheet()-&gt;getColumnDimension('H')-&gt;setWidth(30);
  $objPHPExcel-&gt;getActiveSheet()-&gt;getColumnDimension('I')-&gt;setWidth(30);
  $objPHPExcel-&gt;getActiveSheet()-&gt;getColumnDimension('J')-&gt;setWidth(30);
  $objPHPExcel-&gt;getActiveSheet()-&gt;getColumnDimension('K')-&gt;setWidth(30);
  $objPHPExcel-&gt;getActiveSheet()-&gt;getColumnDimension('L')-&gt;setWidth(30); 
  
  // Save as an Excel BIFF (xls) file 
  $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); 
  
  header('Content-Type: application/vnd.ms-excel'); 
  header('Content-Disposition: attachment;filename="WNPQuarterlyReports.xls"'); 
  
  $objWriter-&gt;save('php://output'); 
  exit(); 
  } 
  echo 'a problem has occurred... no data retrieved from the database'; 
  </code></pre>