title: Correct Implementation of Export Plugin for Grails to export a GSP as PDF
body: <p>I am a fairly new developer in Grails using STS 3.2 (grails version 2.2.0) and I have an application where I want to export data from a GSP to PDF format. I have installed the Export 1.5 plugin and have a reportController with the following:</p>
  
  <pre><code>def pdf = { results-&gt;
      def table = results['tables'][params.reportNum.toInteger()]
      def headers = table?.getAt(0).collect{ it.key }
      def rows = table*.collect{ cleanNull(it.value.toString()) } //data  
      exportService.export("$params.renderAs", response.outputStream, headers, rows, parameters)
  }
  </code></pre>
  
  <hr>
  
  <p>Can someone help me get this wired up correctly? I do know that the exportService expects this, but not sure if I have everything collected that I need to to get this to work:</p>
  
  <p>export(String type, OutputStream outputStream, List objects, Map formatters, Map parameters)        }</p>
  
  <p>I hope I have been clear with my question...Thanks in advance!</p>