The JRXML files cannot be used directly to generate reports. They need to be compiled into JasperReports' native binary format. Compiled report templates are called jasper files. There are two ways to compile a JRXML file into a jasper file: We can do it either programmatically or through a custom ANT task provided by JasperReports.
A JRXML template can be compiled into a jasper file and saved to disk by calling the
compileReportToFile() method on the
net.sf.jasperreports.engine.JasperCompileManager class. The three overloaded versions of the
JasperCompileManager.compileReportToFile() method are listed below:
JasperCompileManager.compileReportToFile(String sourceFileName) ...