在JasperReports中超过Excel中的行限制65536

时间:2014-11-28 09:16:53

标签: java jasper-reports

在点击数据库时,我收到了超过80000条记录。我使用JasperReports将它们导出到Excel中,但Excel可以保持行限制为65536.

如何在单个报告中导出所有记录,或者如何在超过65536时创建新的Excel?我经历了这个链接,但我没有得到的东西: Is it possible to see more than 65536 rows in Excel 2007?

这是主要问题:列表对象包含80000多条记录。如果超过65536行,如何将列表对象分成两个JasperPrint对象?

如果我能够将列表对象划分为两个JasperPrint对象,那么我们可以愉快地将两个JasperPrint对象添加到一个集合中然后我们可以将集合对象添加到JRExporter对象这里是代码向集合中添加两个JasperPrint个对象:    How do you export a JasperReport to an Excel file with multiple worksheets?

到目前为止,这是我的代码:

JRDataSource datasource = new JRBeanCollectionDataSource(
                            confirmList);
                    JasperReport jasperReport = (JasperReport) JRLoader
                            .loadObject(reportPath);
                    Map parameters = new HashMap();
                    parameters.put("title", "Reports for "
                            + "confirmed");
                    JasperPrint jasperPrint = JasperFillManager.fillReport(
                            jasperReport, parameters, datasource);

任何人都可以指导我如何做到这一点吗?

1 个答案:

答案 0 :(得分:1)

参考Excel specifications and limits

  

适用于:Excel 2010

     

工作表大小1,048,576行16,384列

<强>建议

升级到Excel 2010