Search code examples
jasper-reportsexport-to-excel

Exporting from Jasper to Excel


I am trying to export iReport from jasper to excel but the cells keep changing my data type from number to string. Please can anyone help with xml property to correct this?


Solution

  • Part of jrxml with definition of fields make question more correct

    Check type of $F{yourField} (not java.lang.String).

    Set detect cell type in yourReport.jrxml

    <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" ...>
      <property name="net.sf.jasperreports.export.xls.detect.cell.type" value="true"/>
    

    HTH