title: Displaying excel file in a browser. PHPExcel
body: <p>For example I'm using such a code:</p>
  
  <pre><code>&lt;?php
  
      require_once("D:\server/www/cls/PHPExcel.php");
      require_once("D:\server/www/cls/PHPExcel/IOFactory.php");
  
      $objPHPExcel = new PHPExcel();
  
      $objPHPExcel-&gt;setActiveSheetIndex(0)-&gt;setCellValue('B2', 'HeaderB');    
      $objPHPExcel-&gt;setActiveSheetIndex(0)-&gt;setCellValue('C2', 'HeaderC');
      $objPHPExcel-&gt;setActiveSheetIndex(0)-&gt;setCellValue('D2', 'HeaderD');    
      ob_end_clean();
  
      header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
      header("Cache-Control: no-store, no-cache, must-revalidate");
      header("Cache-Control: post-check=0, pre-check=0", false);
      header("Pragma: no-cache");
      header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
      header('Content-Disposition: attachment;filename="report.xlsx"');
  
      $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
      ob_end_clean();
  
      $objWriter-&gt;save('php://output');
  ?&gt;
  </code></pre>
  
  <p>It downloads <code>report.xlsx</code> file and doesn't display it in a browser. How do I make it?</p>
  
  <p>Thanks!</p>