dwfletcher Posted November 11, 2009 Share Posted November 11, 2009 I have already used a JRVirtualizer to avoid out of memory problems when filling a report. However, my application always fills a report then persists the JasperPrint object into a file for later viewing. So if the report is large and would have caused an out-of-memory error when filling without a JRVirtualizer, then it will cause an out-of-memory errory when I read it back in to exporting to some other format.I need to have some mechanism to persist large JasperPrint objects and then re-import them for export to other formats. Likely, I will need to persist them as XML since in the future I may want to upgrade my JasperReports version and must support re-importing of reports that were generated with the previous version. So it seems I would need a JRPrintXMLLoader that would use a JRVirtualizer.I see other threads that are similar to this (some very old). Is there only work in this direction? Link to comment Share on other sites More sharing options...
dwfletcher Posted November 18, 2009 Author Share Posted November 18, 2009 I have discovered how to use a virtualizer when de-serializing a JasperPrint object, so I have answered my own question there. I still have the question of forward compatibility of serialized JasperPrint objects - if i save a JasperPrint object to a file now by serialization, then upgrade to a later version of Jasper, am i guaranteed that I will be able to deserialize with the new version of Jasper? Link to comment Share on other sites More sharing options...
Teodor Danciu Posted November 24, 2009 Share Posted November 24, 2009 Hi, Deserializing with future version should work. In case you spot a bug, let us know. Thanks,Teodor Link to comment Share on other sites More sharing options...
Teodor Danciu Posted November 24, 2009 Share Posted November 24, 2009 Hi, One more thing. Deserialization should work, but only if we talk about JR objects. We cannot guarantee that deserializing a JFreeChart object embedded into one of our reports would work in the future (it probably won't).So you would need to make sure that charts (or other graphics) are rendered either as images or SVG, using their renderType attribute. I hope this helps.Teodor Link to comment Share on other sites More sharing options...
dwfletcher Posted November 24, 2009 Author Share Posted November 24, 2009 Thanks for the answers Teodor. This will help alot.Duane Link to comment Share on other sites More sharing options...
lexx_pangcats Posted December 16, 2009 Share Posted December 16, 2009 Hi dwfletcher,Can you please share to me code snippets on how you handle large jasperprint object when generating huge report? tnx. Link to comment Share on other sites More sharing options...
lexx_pangcats Posted December 16, 2009 Share Posted December 16, 2009 Actually I already used the three types of virtualizer still didn't help my problem.The "out of memory" error occured during export. My jasperprint object have 7,984 no. of pages. tnx. Link to comment Share on other sites More sharing options...
Teodor Danciu Posted December 16, 2009 Share Posted December 16, 2009 Hi, To what format have you exported? Even when using the virtualizer, some third party libraries that we use to generate XLS still build up things in memory before creating the actual file. JR virtualizers do not solve the memory problems of the third party libraries. Thanks,Teodor Link to comment Share on other sites More sharing options...
dwfletcher Posted December 16, 2009 Author Share Posted December 16, 2009 Please see the virtualizer sample delivered with JasperReports. If this doesn't help, let me know. Link to comment Share on other sites More sharing options...
joaaquinn Posted December 6, 2012 Share Posted December 6, 2012 I have the same problem seems impossible to export to excel a large file. I've used virtualize in jasper print object but it hangs when it execute the JRXlsExporter.exportReport()What is the solution for that?ThanksJoaquin Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now