title: Yii Framework generating ms-word documents
body: <p>I'm trying to generate a ms-word document with Yii. I'm finding very difficult to do it. I found this example <a href="http://www.yiiframework.com/forum/index.php?/topic/16669-exporting-to-ms-word/" rel="nofollow">Generating ms-word</a> but I cannot get it to work.</p>
  
  <pre><code>View:
  echo CHtml::ajaxLink(
      'Generate Word',
      CController::createUrl('Calculator/generateWord'), array(
          'type'    =&gt; 'POST',
      ), array('id'=&gt;'gen_word')
  );
  
  Controller:
  $var = "hello";
  $div = $this-&gt;renderPartial('graphs/print', array('var'=&gt;$var), true);
  header("Pragma: no-cache"); // required
  header("Expires: 0");
  header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
  header("Cache-Control: private", false); // required for certain browsers
  header("Content-type: application/vnd.ms-word");
  header("Content-Disposition: attachment; filename=\"test.doc");
  header("Content-Transfer-Encoding: binary");
  ob_clean();
  flush();
  echo $div;
  
  graphs/print:
  &lt;table&gt;
      &lt;tr&gt;
          &lt;td&gt;This is just s test&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;?php echo $var; ?&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>When I click on the link "Generate Word" it doesn't do anything.</p>