title: How to Generate Excel File With Autofilters in PHP?
body: <p>Okay, here's my dilemma.</p>
  
  <p>I've been working on a Wordpress plugin for <a href="http://www.medicalmarcom.com">Medical Marcom</a> to automatically update his List of US Twitter Doctors. Basically, it provides the ability to create a form where users can request to be added to the list, requests can be confirmed in the admin panel, when added they're available in the Excel file and the initial data is filled out, and finally, certain fields are automatically updated throughout the week.</p>
  
  <p>Here's the problem.</p>
  
  <p>My code is generating an Excel file with PHP using PHPExcel. However, I need to have a simple autofilter applied to the sheet at startup (honestly, I don't know what the big deal is... anyone can easily apply an autofilter in Excel, but he wants it available from the start). So, I tried applying the code I found:</p>
  
  <pre><code>$excel-&gt;getActiveSheet()-&gt;setAutoFilter('A1:J' . $row);
  </code></pre>
  
  <p>$excel is my PHPExcel instance. $row is the last row being outputted from the database. The file is generated immediately when the url is clicked and PHP's headers are set to translate the output as an Excel file, like so:</p>
  
  <pre><code>header("Content-type: application/vnd.ms-excel");
  header("Content-Disposition: attachment; filename=" . $file);
  </code></pre>
  
  <p>But when I open the file, no autofilters are set... I tried <a href="http://phpexcel.codeplex.com/workitem/16493">posting a question over at PHPExcel's website</a>, but I didn't get any replies, so I decided to ask here.</p>
  
  <p>Does anyone know what I may be doing wrong? For now he's going with the original file (updated a bit, though) until this issue is resolved.</p>