Reputation: 416
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.
Upvotes: 0
Views: 5508
Reputation: 4096
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
Upvotes: 1
Reputation: 724
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
Upvotes: 1