Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it better to use .jasper or .jrxml in web application?

I have been working with jasper reports for quite some time
All these days, I have compiled .jrxml files using IReport tool and copied the .jasper file in
my web application. I know of the JaperCompileManager which does compiling of .jrxml and produce .jasper files at the run time. Have few queries about it

  1. Will it compile and produce .jasper file each time I open the report or compile and preserve the .jasper file till any change happens in .jrxml file?
  2. Is there any performance impact in doing this run time compilation
  3. Which approach is better? Using pre compiled jasper files or use .jrxmls for run time compilation?
like image 564
Akhil Avatar asked Oct 21 '25 03:10

Akhil


1 Answers

Jasper files, are jrxml files compiled into Java bytecode, JasperReports requires the use of Jasper files so you need to compile your jrxml files for it to work, the compilation step is pretty costly, but it can be done once if you have the file cached somewhere and use something like what's defined here: How to compile .jrxml only once; however, if your reports are inmutable, then you're better compiling your reports before deploying them, both for performance and security purposes.

By the way, the official way of deploying Jasper reports is just deploy the jasper file.

like image 97
Miguel Garcia Avatar answered Oct 23 '25 21:10

Miguel Garcia



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!