'Why was Jasper support dropped out from Spring Framework 5.x?

We have been using Jasper with Spring Boot for our project's reporting feature but according to the Spring Framework 5.x release documentation Jasper support has been dropped out.

  • May I know why this has been done?

They have recommended to stay on Spring Framework 4.3.x in case we need Jasper support.

  • What if we want to upgrade to Spring Framework 5.x and still use Jasper, is there any alternative for doing so ?


Solution 1:[1]

We have upgraded to Jaspersoft 6.8.1(Open Source) and Jaspersoft Pro 7.3.1 with Spring 5.1.20. We found below problems while upgrading:

  1. Initially Font Extensions were not working. So, we created it again using Jaspersoft 7.3.1 Studio.
  2. There was a js file called jrs.configs.js which got introduced in Jasperreports Highcharts library was not loading because of which our Highcharts were not loading in embedded environment. We have put the file in the location where it was searching inside our web app. After that, everything is working.

Solution 2:[2]

I had to upgrade to Spring 5 and this worked for me:

@GetMapping(value = "/report1")
  public void getPdf(HttpServletResponse response) throws JRException, IOException {
    InputStream jasperStream = this.getClass().getResourceAsStream("/jasperreports/HelloWorld1.jasper");
    Map<String,Object> params = new HashMap<>();
    JasperReport jasperReport = (JasperReport) JRLoader.loadObject(jasperStream);
    JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, params, new JREmptyDataSource());

    response.setContentType("application/x-pdf");
    response.setHeader("Content-disposition", "inline; filename=helloWorldReport.pdf");

    final OutputStream outStream = response.getOutputStream();
    JasperExportManager.exportReportToPdfStream(jasperPrint, outStream);
  }

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Matias Salazar