How can I generate a report with nested List using Jasper Report (using Spring Boot)

0

Hello,

I am trying to generate a PDF report using the following entities, but I cannot do it.

public class EmployeeReportData {
 
    private int id;
    private string firstName;
    private string lastName;
    private string department;
 
    private List<WorkedDayAndHours> dayAndHours;
 
    // Getters and Setters
    ...
}
 
public class WorkedDayAndHours {
 
    private Date workedDay;
    private int workedHours;
 
    // Getters and Setters
    ...
}

I would like to create a PDF report using the EmployeeReportData class. Something like the following output:

ID First Name Last Name Department Worked Day Worked Hours
1 John Wick Security 10 / 02 / 2021 8
2 John Wick Security 12 / 02 / 2021 9
Total Worked Hours 17
3 Marco Polo Cloud 12 / 02 / 2021 8
Total Worked Hours 8

Is it possible to implement something like this using Spring Boot and Jasper Report? The only issue I have is the List<WorkedDayAndHours> inside the EmployeeReportData class. I do not know how to work with nested lists inside an object.

Normally, I would like to send to jasper a List<EmployeeReportData > which contains a List<WorkedDayAndHours> for each EmployeeReportData record.

fiyov46807's picture
Joined: Apr 28 2020 - 12:01am
Last seen: 1 week 6 days ago

0 Answers:

No answers yet
Feedback