Я хочу сообщить о разнице между endDate и startDate в коллекции заданий. Я создал шаблон в Jasper Studio.
Код: Выделить всё
@Document(collection = "assignment")
public class Assignment {
@Id
private String id;
private String bookId;
private String memberId;
private LocalDate startDate;
private LocalDate endDate;
private int duration;
}
Код: Выделить всё
Код: Выделить всё
@GetMapping("/report")
public byte[] generateReport() throws Exception {
try{
List assignmentDTOList= assignmentService.findAll();
Map params= new HashMap();
params.put("CompanyName", "Uzan");
params.put("AssignmentList", new JRBeanCollectionDataSource(assignmentDTOList));
JasperPrint assignReport= JasperFillManager.fillReport(JasperCompileManager.compileReport(ResourceUtils
.getFile("classpath:duration.jrxml").getAbsolutePath()), params, new JREmptyDataSource());
return new ResponseEntity(JasperExportManager.exportReportToPdf(assignReport), null, HttpStatus.OK).getBody();
}
catch (Exception e){
return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR).getBody();
}
}
Caused by: net.sf.jasperreports.engine.JRRuntimeException: No query executer factory registered for the "MongoDbQuery" language.
How can I fix this?
Источник: https://stackoverflow.com/questions/781 ... -in-jasper