2010-12-15 68 views
0

我正在使用JRBeanCollectionDataSource導出記錄爲PDF格式。所以,我通過List來創建數據源JRBeanCollectionDataSource。在最後生成的文件不完整。含義一樣,讓說JRBeanCollectionDataSource - bean完整值不導出

public class myClassTOBean { 

    private String var; 

    //getter and setter blah blah... 

} 

在這上面的類變量var具有價值「FULL STRING」,其中作爲最終生成的報告具有價值爲「FULL STRIN」。爲什麼會發生像。 可能是什麼問題?

這是我用來導出的一段代碼。

JasperPrint jPrint; 
      try { //dataSouce is List of BeanTO class 
       JRBeanCollectionDataSource dataSource 
           = new JRBeanCollectionDataSource(dataList); 
       jPrint = JasperFillManager.fillReport(jasperFileFullName, 
         paramMap, dataSource); 
       exporter.setParameter(JRExporterParameter.JASPER_PRINT, jPrint); 
       exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, out); 
       exporter.setParameter(JRExporterParameter.CHARACTER_ENCODING, 
         ReportConstant.FILE_ENCODING); 
       exporter.exportReport(); 
      }finally{ 
       //close stream 
      } 

回答

0

最有可能您的字段不夠大並且正在修剪其內容。擴展字段(在iReport中)並重試。

+0

你的意思是在jrxml中的字段大小正確嗎?它仍然無法工作:( – 2010-12-15 12:05:58

+0

重新編譯,並確保部署了最新版本的.jasper文件。 – Bozho 2010-12-15 12:15:05