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