I'm working on a struts
based application. I want to create a Jasper report containing questions and responses for a Paper
Object. Clearly I have a List of Paper
objects containing part attribute and each Paper
object internally has a List of Questions
. Also each Question
has a List of Responses.
I could create the main report with Paper object which displays different part names. But I want to display the questions associated with the part and responses associated with each question.
My Model classes will be:
// Paper
public class Paper {
public String partName;
public List<Question> questions;
}
// Question
public class Question {
public String question;
public List<Answer> answers;
}
// Answer
public class Answer {
public String answer;
}
I know I have to use subreport in iReport
. When i did so the compilation fails for the data source expression new JRBeanCollectionDataSource($F{questions})