title: How do I get the Grails Export plugin to work correctly with criteria queries?
body: <p>I'm trying to get a Criteria query to be exported to CSV, Excel, what have you.  The issue I'm running into is that the categories code runs cleanly (as in, doesn't throw any errors), but it doesn't generate any data.  I know for a fact that <code>data</code> is an ArrayList of List.  Anyone have a workaround for this, or tell me if I'm doing something wrong?</p>
  
  <p>Here's my domain object:</p>
  
  <pre><code>class Machine {
      String name,
             category
      // constraints, etc
  }
  </code></pre>
  
  <p>Here's my controller action (taken mostly from the <a href="http://www.grails.org/plugin/export" rel="noreferrer">plugin page</a>):</p>
  
  <pre><code>def categories = {
      if(params?.format &amp;&amp; params.format != "html"){
   response.contentType = ConfigurationHolder.config.grails.mime.types[params.format]
   response.setHeader("Content-disposition", "attachment; filename=categories.${params.extension}")
  
      def data = Machine.createCriteria().list {
          projections {
              groupProperty("category")
              countDistinct("id")
          }
      }
  
      exportService.export(params.format, response.outputStream, data, [:], [:])
  }
  </code></pre>