You specify the JasperPrint file, not the JasperReport file. Let me split the files and what they are:
- report.jrxml - jasper report definition in xml - this defines the report, but cannot be used directly to generate output.
- report.jasper - compiled jrxml file (JasperReport). This can be used as an input to populate the report with data.
- report.jprint - , , .
jrxml , , pdf:
Connection connection = PersistenceSessionFactory.getSqlSession().getConnection();
JasperReport report = JasperCompileManager.compileReport( "FancyPantsReport.jrxml" );
HashMap<String, Object> params = new HashMap<String,Object>();
params.put( "sqlDate", fromDate );
JasperPrint printedReport = JasperFillManager.fillReport(report, params, connection);
String outputFilename = "FancyPants-" + dateString + ".pdf";
JasperExportManager.exportReportToPdfFile( printedReport, outputFilename );
LOG.info("Report Generated in " + (System.currentTimeMillis() - start) + "ms");
, JasperReport jrxml, FillManager, JasperPrint JasperReport , , JasperPrint pdf.