title: phpspreedsheet data coming out corrupt format
body: <p>Just starting with PHP spreed sheets.</p>
  
  <p>But when I save it's creating the file weird, please see the photos attached.</p>
  
  <p>I don't understand why it is doing it....</p>
  
  <p>now updated so straight to point with code below...?</p>
  
  <p>Thanks in advance for help ....................</p>
  
  <pre><code>        &lt;?php
      require __DIR__ . '/vendor/autoload.php';
      use PhpOffice\PhpSpreadsheet\IOFactory;
      use PhpOffice\PhpSpreadsheet\Spreadsheet;
      use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
  
      $spreadsheet = new Spreadsheet();
  
  
      $spreadsheet-&gt;setActiveSheetIndex(0)
      -&gt;setCellValue('A1', 'Reorder Report')
      -&gt;setCellValue('A3', 'Report Created Date:')
      -&gt;setCellValue('A4', 'Supplier:')
      -&gt;setCellValue('A6', 'Period 1:')
      -&gt;setCellValue('A7', 'Period 2:')
      -&gt;setCellValue('A8', 'Period 3:')
      -&gt;setCellValue('A10', 'Order to delivery time:')
      -&gt;setCellValue('A11', 'Hold stock after order arrived:')
      -&gt;setCellValue('A14', 'Product Code')
  
      -&gt;setCellValue('B3', '')//create date *to add todays date
      -&gt;setCellValue('B4', '')//supplier name
      -&gt;setCellValue('B5', 'Days:')
      -&gt;setCellValue('B6', '')
      -&gt;setCellValue('B7', '')
      -&gt;setCellValue('B8', '')
      -&gt;setCellValue('B10', '')
      -&gt;setCellValue('B11', '')
      -&gt;setCellValue('B14', 'Description')
  
      -&gt;setCellValue('C5', 'Start Date:')
      -&gt;setCellValue('C6', '')
      -&gt;setCellValue('C7', 'End Date:')
      -&gt;setCellValue('C8', '')
      -&gt;setCellValue('C14', 'Stock')
      ;
  
  
  
  // Set active sheet index to the first sheet, so Excel opens this as the first sheet
  $spreadsheet-&gt;setActiveSheetIndex(0);
  
  // Redirect output to a client’s web browser (Xls)
  header('Content-Type: application/vnd.ms-excel');
  header('Content-Disposition: attachment;filename="01simple.xls"');
  header('Cache-Control: max-age=0');
  // If you're serving to IE 9, then the following may be needed
  header('Cache-Control: max-age=1');
  
  // If you're serving to IE over SSL, then the following may be needed
  header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
  header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified
  header('Cache-Control: cache, must-revalidate'); // HTTP/1.1
  header('Pragma: public'); // HTTP/1.0
  
  $writer = IOFactory::createWriter($spreadsheet, 'Xls');
  $writer-&gt;save('php://output');
  exit;
  
  ?&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/AYRFN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AYRFN.png" alt="enter image description here"></a></p>