Jump to content
Changes to the Jaspersoft community edition download ×

How to use object of a class which contain object of another class as datasource in jasper report?


mouhsine.elidrissi

Recommended Posts

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

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...