JRBeanCollectionDataSource - bean完整值未导出

时间:2010-12-15 10:46:41

标签: java jasper-reports

我使用JRBeanCollectionDataSource将记录导出为PDF格式。所以,我将List传递给JRBeanCollectionDataSource来创建dataSource。在最终生成的文件中未完成。意思是,让我们说

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
            }

1 个答案:

答案 0 :(得分:0)

很可能你的领域不够大并正在修剪其内容。扩展字段(在iReport中)并重试。