title: PHPExcel setCellValueByColumnAndRow not writing data to spreadsheet
body: <p>i'm outputting data from a mysql database to an excel workbook using PHPExcel. My workbook has 3 sheets and most of it is working fine. I'm having problems with the last section of output to the third sheet. What I am trying to do is output a table with row headers and column headers the values of which are taken from a mysql table and then a figure per row/column combination also taken from the mysql table based on what that row/column header is. The row and column headers are written to the file as they should be but the inner table figures are not. When I echo the output to screen all the data is appearing and the row/ column iterations are incrementing as they should just the setCellValueByColumnAndRow appears to not be setting the values in the worksheet. The section of code that i'm having trouble with is below. Can anyone see where the problem is in my code? </p>
  
  <pre><code>$objPHPExcel-&gt;setActiveSheetIndex(2);
  
  while($srow = mysql_fetch_assoc($query_company))
  {
  $newarray[] = $srow['entity'];
  }
  $row4 = 2;
  $col4 = 1;
  while($trow = mysql_fetch_row($query_ctry))
  {
  $country = $trow[0];
  
  while($comp = each($newarray))
  {
  $company = $comp[1];
  $total = mysql_query("SELECT noparts FROM totalslist WHERE country = '$country' AND entity = '$company'") or die (mysql_error());
  if ($numrows = mysql_num_rows($total) == 0)
  {
  $totalres = 0;
  }
  else
  {
  $result3 = mysql_fetch_row($total);
  $totalres = $result3[0];
  }
  
  $objPHPExcel-&gt;getActiveSheet()-&gt;setCellValueByColumnAndRow($col4, $row4, $totalres); 
  $col4++;
  
  }
  reset($newarray);
  $row4++;
  $col4 = 1;
  }
  </code></pre>