title: Export With Box Spout
body: <p>I am trying to implement Box/Spout into a project of mine and I want to export some data.
  The thing is that when I tried to make a test file to get downloaded it doesn't work, it's just a simple white page and the .xlsx download is not triggered.</p>
  
  <p>Below is my code:</p>
  
  <pre><code>&lt;?php
  
  require_once 'vendor/box/spout/src/Spout/Autoloader/autoload.php';
  
  use Box\Spout\Writer\Common\Creator\WriterEntityFactory;
  use Box\Spout\Common\Entity\Row;
  
  function xlsx(){
      $writer = WriterEntityFactory::createXLSXWriter();
      // $writer = WriterEntityFactory::createODSWriter();
      // $writer = WriterEntityFactory::createCSVWriter();
      $writer-&gt;setShouldUseInlineStrings(true); // default (and recommended) value
  
      $writer-&gt;setTempFolder($customTempFolderPath);
  
      $fileName = 'test.xlsx';
  
      // $writer-&gt;openToFile($filePath); // write data to a file or to a PHP stream
      $writer-&gt;openToBrowser($fileName); // stream data directly to the browser
  
      $cells = [
          WriterEntityFactory::createCell('Carl'),
          WriterEntityFactory::createCell('is'),
          WriterEntityFactory::createCell('great!'),
      ];
  
      /** add a row at a time */
      $singleRow = WriterEntityFactory::createRow($cells);
      $writer-&gt;addRow($singleRow);
  
      /** add multiple rows at a time */
      $multipleRows = [
          WriterEntityFactory::createRow($cells),
          WriterEntityFactory::createRow($cells),
      ];
      $writer-&gt;addRows($multipleRows); 
  
      /** Shortcut: add a row from an array of values */
      $values = ['Carl', 'is', 'great!'];
      $rowFromValues = WriterEntityFactory::createRowFromArray($values);
      $writer-&gt;addRow($rowFromValues);
  
      $writer-&gt;close();
  
  }
  </code></pre>
  
  <p>This is a sample taken from the official documentation: <a href="https://opensource.box.com/spout/" rel="nofollow noreferrer">https://opensource.box.com/spout/</a></p>
  
  <p>Is there something I missed? What I am doing wrong?</p>