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
}
你的意思是在jrxml中的字段大小正確嗎?它仍然無法工作:( – 2010-12-15 12:05:58
重新編譯,並確保部署了最新版本的.jasper文件。 – Bozho 2010-12-15 12:15:05