I have this code. I have a jrxml file. I can create a jasperReport object successfully. But I don't know how to create jasper file from this and I want to save jasper to a file location in c drive.
JasperReport jasperReport = null;
JasperCompileManager.compileReport(getResourceAsStream("Sample_Report.jrxml"));
try {
jasperReport = JasperCompileManager
.compileReport("C:\\xxx.jrxml");
System.out.println("jasper created " + jasperReport);
} catch (Exception e) {
e.printStackTrace();
}
The Method you want to use is
JasperCompileManager.compileReportToFile("C:\\xxx.jrxml", "C:\\xxx.jasper");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With