I want to generate report using jasperreport and spring boot. The problem is that my class has relations with other classes ( e.g ManyToOne).Please how to print data of my class and of the other classes in the same report. Igot this error in the browser ( Error evaluating expression for source text: $F{domain} ) and in the console (ma.te.sa.ab.model.Domain cannot be cast to java.lang.String).
How to use object of a class which contain object of another class as datasource in jasper report?
in Products
Posted
I want to generate report using jasperreport and spring boot. The problem is that my class has relations with other classes ( e.g ManyToOne).Please how to print data of my class and of the other classes in the same report. Igot this error in the browser ( Error evaluating expression for source text: $F{domain} ) and in the console (ma.te.sa.ab.model.Domain cannot be cast to java.lang.String).
A part of my class :
public class Risque {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "CUST_SEQ")
@SequenceGenerator(sequenceName = "customer_seq", initialValue = 1, allocationSize = 1, name = "CUST_SEQ")
private Long id;
private String titre;
private String description;
private String responsable;
@ManyToOne(fetch = FetchType.EAGER)
private Domain domain;
@ManyToOne(fetch = FetchType.EAGER)
private Probabilite probabilite;
@ManyToOne(fetch = FetchType.EAGER)
private Gravite gravite;
@ManyToOne(fetch = FetchType.EAGER)
private Criticite criticite;
// getters ans setters