In my Spring boot webapp I am trying to implement some backend functionalities to generate PDF files using JasperReports
.
I have a file structure looking like this:
The app, when running, has no problem in seeing the application-*.properties
, or any files in static
folder.
I have written a piece of code to just generate the report and show it in JasperViewer
:
JasperPrint print = null;
try {
JasperCompileManager.compileReportToFile("invoices/invoice.jrxml");
print = JasperFillManager.fillReport("invoices/invoice.jasper", new HashMap<>());
JasperViewer jasperViewer = new JasperViewer(print);
jasperViewer.setVisible(true);
} catch (JRException e) {
e.printStackTrace();
}
But when I'm trying to run the app, all I get is:
net.sf.jasperreports.engine.JRException: java.io.FileNotFoundException: invoices/invoice.jrxml (No such file or directory)