title: Failed to generate word document from liferay portlet
body: <p>I am trying to generate a report document from liferay portlet. The method I am using for report generation is already using <code>OutputStream</code> that I cannot change. Following is the method signature.</p>
  
  
  
  <pre class="lang-java prettyprint-override"><code>public void generateReport(OutputStream outPut);
  </code></pre>
  
  <p>I am passing the <code>OutputStream</code> to the method using the following lines:</p>
  
  <pre class="lang-java prettyprint-override"><code>PortletResponse portletResponse = (PortletResponse)externalContext.getResponse();
  HttpServletResponse httpResponse = PortalUtil.getHttpServletResponse(portletResponse);
  </code></pre>
  
  <p>Then I'm calling the method using the following line:</p>
  
  <pre class="lang-java prettyprint-override"><code>generateReport(httpResponse.getOutputStream());
  </code></pre>
  
  <p>This runs successfully but nothing happens.</p>
  
  <p>I have to generate a report using the above method in my portlet. Any idea?</p>