Hi, I am working on a web application. We are using jasperreports. Compiling jasperreports on every call is an overhead and takes considerable time (4-7 seconds). We thought of precompiling the jrxmls using Spring but still have the ability to re-generate if the jrxml is changed/modified. Has anybody done this before? If yes, how. Thanks
+1
A:
- You can schedule a timer which re-compiles new jasper reports every X hours (check here)
- You can load the jrxml as
File
and check itslastModified()
, store it in a database (or aHashMap
), and on each subsequent need for the jrxml to compare thelastModified()
to the value in the database /HashMap
and recompile it only if they differ - combine the two methods above
- create a simple interface (a password-protected page) that lists all jrxml files with a button "compile", so that whenever you change something, you go to that page and indicated which jrxmls should be recompiled.
Bozho
2010-01-17 09:03:45
+1 for the Admin page. that could be used for many things.
medopal
2010-01-20 10:12:21
A:
I don't know your application, but you could look at using JasperServer. This web app has a repository and processes that manage JRXML content and compilation. You could access the app via web services.
Sherman Wood
2010-01-18 03:35:31