kubrauzan Posted March 13 Share Posted March 13 I want to use my mongo collection and report this. But I get this error: Caused by: net.sf.jasperreports.engine.JRRuntimeException: No query executer factory registered for the "MongoDbQuery" language. My controller: How can I fix this issue? @GetMapping("/report") public byte[] generateReport() throws Exception { try{ List<AssignmentDTO> assignmentDTOList= assignmentService.findAll(); Map<String, Object> params= new HashMap<String, Object>(); params.put("CompanyName", "Uzan"); params.put("AssignmentList", new JRBeanCollectionDataSource(assignmentDTOList)); JasperPrint jasperPrint= JasperFillManager.fillReport(JasperCompileManager.compileReport(ResourceUtils .getFile("classpath:books_count_pie.jrxml").getAbsolutePath()), params, new JREmptyDataSource()); return new ResponseEntity<byte[]>(JasperExportManager.exportReportToPdf(jasperPrint), null, HttpStatus.OK).getBody(); } catch (Exception e){ return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR).getBody(); } } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now