Handle Huge Data in Jasper Reports - pagining

有些话、适合烂在心里 提交于 2019-12-11 20:28:21

问题


I want to handle huge data in creating PDF, I know there is a thing called Virtualizers in Jasper Reports, but i don't know how to handle the out of memory exception that is fired when i retrieve the data from the DAOs, I don't know how to implement pagination in Jasper reports datasources.


回答1:


To understand Virtualizers you can read "Large File Support" section of Jasper Reports Ultimate Guide (available here: http://community.jaspersoft.com/documentation).

Example of JRSwapFileVirtualizer usage can be found here: how to select and configure a JasperReports virtualizer?.

If you're still running out of memory, you may need to increase the memory limit using -Xmx JVM option (in server startup script or eclipse run configuration arguments - depends on your environment), for example:

-Xmx1024M



回答2:


You need a custom implementation of JRDatasource and a Virtualizer, Your implementation of JRDatasource should load data in chunks

You can set net.sf.jasperreports.jdbc.fetch.size in jasperreports.properties too, if you are using JRResultSetDataSource



来源:https://stackoverflow.com/questions/19476535/handle-huge-data-in-jasper-reports-pagining

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!