----------------------------------------tips.tricks.html
8. Support for large reports
For filling and exporting large documents that would normally eat up memory and crash with an OutOfMemory exception, there is now a new feature called "report virtualizer" that uses serialization of temporary data on disk to optimize memory consumption.
This can be seen in action in the supplied /demo/samples/virtualizer sample provided. This new feature is a contribution from Works Inc.
------翻译 -------
当填充和输出大数据量的报表时,它会耗净我们的内存并且报OutOfMemory的异常.现在有一个新的特性叫"report virtualizer"可以用来序列化临时数据到硬盘上来优化内存的使用.
我们可以在 /demo/samples/virtualizer 上看到它的使用,它是由Works Inc来开发的.
.........
JRFileVirtualizer virtualizer = new JRFileVirtualizer(2, "tmp");
.....
// Preparing parameters
Map parameters = new HashMap();
parameters.put(JRParameter.REPORT_VIRTUALIZER, virtualizer);
JasperPrint jasperPrint = JasperFillManager.fillReport(fileName, parameters, dataSource);
virtualizer.setReadOnly(true);
..........
另:看到几个有用的
net.sf.jasperreports.view.JasperDesignViewer
可以直接浏览xml 或jasper的设计图