title: Jasper CSV Report | Column header coming at random row number
body: <p>Hi I have a Jasper JRXML report and it is used to generate PDF and CSV report.  The PDF report is generated fine but when CSV report is generated the Column header comes in different line.
  The column header should come in first line but instead it comes at some random line.
  The data source used is XML.</p>
  
  <p>See below is the output:</p>
  
  <p><code>"As Of: April 1, 2015","S14G"
  "Frequency","Fund No.","Fund 
  "As Of: April 1, 2015","S14G"
  "As Of: April 1, 2015","S14G"
  "As Of: April 1, 2015","S14G"
  </code>
  Snippet for JRXML is below:</p>
  
  <p><code>&lt;detail&gt;
          &lt;band height="33" splitType="Stretch"&gt;
              &lt;textField isBlankWhenNull="true"&gt;
                  &lt;reportElement key="CSV Frequency" mode="Transparent" x="80" y="0" width="3" height="10"&gt;
                      &lt;property name="net.sf.jasperreports.export.csv.column.name" value="Frequency"/&gt;
                      &lt;property name="net.sf.jasperreports.export.csv.repeat.value" value="true"/&gt;
                      &lt;propertyExpression name="net.sf.jasperreports.export.csv.data"&gt;&lt;![CDATA[$P{FREQUENCY_TITLE}]]&gt;&lt;/propertyExpression&gt;
                  &lt;/reportElement&gt;
                  &lt;textElement textAlignment="Center"/&gt;
                  &lt;textFieldExpression class="java.lang.String"&gt;&lt;![CDATA[""]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField isBlankWhenNull="true"&gt;
                  &lt;reportElement key="CSV Group No." mode="Transparent" x="85" y="0" width="3" height="10"&gt;
                      &lt;property name="net.sf.jasperreports.export.csv.column.name" value="Group No."/&gt;
                      &lt;property name="net.sf.jasperreports.export.csv.repeat.value" value="true"/&gt;
                      &lt;propertyExpression name="net.sf.jasperreports.export.csv.data"&gt;&lt;![CDATA[$F{GROUP_ID}]]&gt;&lt;/propertyExpression&gt;
                  &lt;/reportElement&gt;
                  &lt;textElement textAlignment="Center"/&gt;
                  &lt;textFieldExpression class="java.lang.String"&gt;&lt;![CDATA[""]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;</code></p>
  
  <p>and jasper properties set as below:</p>
  
  <p><code>
      &lt;property name="net.sf.jasperreports.export.csv.column.names" value="Frequency,Group No.,Group Name,Program,Coll. Curr.,Base Curr.,Local Cash Coll.,Local Non-Cash Coll.,Local Calculated Mark,Local Market Val.,Base Cash Coll.,Base Non-Cash Coll.,Base Calculated Mark,Base Market Val.,Coll. Percent"/&gt;
      &lt;property name="net.sf.jasperreports.export.csv.write.header" value="true"/&gt;</code></p>
  
  <p>Can some one please guide me where I am going wrong.</p>