Guest User

Untitled

a guest
Jan 20th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. <dependency>
  2. <groupId>net.sf.jasperreports</groupId>
  3. <artifactId>jasperreports</artifactId>
  4. <version>4.1.2</version>
  5. </dependency>
  6. <dependency>
  7. <groupId>org.codehaus.groovy</groupId>
  8. <artifactId>groovy-all</artifactId>
  9. <version>1.7.5</version>
  10. </dependency>
  11.  
  12. public class JasperReportsIntro
  13. {
  14. public static void main(String[] args)
  15. {
  16. JasperReport jasperReport;
  17. JasperPrint jasperPrint;
  18. try
  19. {
  20. jasperReport = JasperCompileManager.compileReport("reports/jasperreports_demo.jrxml");
  21. jasperPrint = JasperFillManager.fillReport(
  22. jasperReport, new HashMap(), new JREmptyDataSource());
  23. JasperExportManager.exportReportToPdfFile(
  24. jasperPrint, "reports/simple_report.pdf");
  25. }
  26. catch (JRException e)
  27. {
  28. e.printStackTrace();
  29. }
  30. }
  31. }
Add Comment
Please, Sign In to add comment