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();
}
}