title: How to sort fields in jasper report
body: <p>I have a list of bean (JRBeanCollectionDataSource) and the goal it's to export it in pdf. But the list should be sorted by the field 'name'.</p>
  
  <p>I can export it in pdf, but it's not sorted.</p>
  
  <p>I have found nothing, just the 'sort component'.</p>
  
  <p>Here is an excerpt of the code :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;field name="name" class="java.lang.String"&gt;
    &lt;fieldDescription&gt;&lt;![CDATA[name]]&gt;&lt;/fieldDescription&gt;
   &lt;/field&gt;
   &lt;field name="fistname" class="java.lang.String"&gt;
    &lt;fieldDescription&gt;&lt;![CDATA[fistname]]&gt;&lt;/fieldDescription&gt;
   &lt;/field&gt;
   &lt;detail&gt;
    &lt;band height="20" splitType="Stretch"&gt;
     &lt;textField pattern="#,##0.00;-#,##0.00"&gt;
      &lt;reportElement x="758" y="0" width="60" height="20" uuid="bbb4c112-0026-4043-9aca-987d1cecf7c9"/&gt;
      &lt;textElement textAlignment="Right" verticalAlignment="Middle"&gt;
       &lt;font size="6"/&gt;
      &lt;/textElement&gt;
      &lt;textFieldExpression&gt;&lt;![CDATA[$F{name}]]&gt;&lt;/textFieldExpression&gt;
     &lt;/textField&gt;
     &lt;textField isStretchWithOverflow="true"&gt;
      &lt;reportElement x="27" y="0" width="225" height="20" uuid="5ab06ade-3b0f-463d-b30d-877592c8cf2b"/&gt;
      &lt;textElement verticalAlignment="Middle"&gt;
       &lt;font size="7"/&gt;
      &lt;/textElement&gt;
      &lt;textFieldExpression&gt;&lt;![CDATA[$F{fistname}]]&gt;&lt;/textFieldExpression&gt;
     &lt;/textField&gt;
    &lt;/band&gt;
   &lt;/detail&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Can you tell me how to sort this list in ireport?</p>