Jump to content

out of memory for re-importing JasperPrint


dwfletcher

Recommended Posts

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

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

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

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

  • 3 weeks later...
  • 2 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...