mouhsine.elidrissi Posted April 28, 2020 Share Posted April 28, 2020 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 Link to comment Share on other sites More sharing options...
I am Leo Posted May 6, 2020 Share Posted May 6, 2020 try to use the getters in Domain class to display a String.Example: $F{domain}.getId() 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