Hi!
Thanks again for your answer and help! Yeah, I figured I'd make a separate question of the pdf generation side. At the moment I'm just trying to figure out which way to go and what technology could be most useful. I have a few things to fix in my code and then I'll have to start getting into pdf stuff. I have never worked with JasperReports, so I'll have to learn as I go. I have printed the guide to iReport and the library.
The report is not going to be a bunch of answers by a bunch of people like a list of questionnaire answers. Rather, the guys I'm writing the program for will have someone visit a business as a client and observe the quality of service and write a report on that. The businesses are auto repair shops and the clients of my friend will be importers of motor vehicles. So basically they will provide pick an auto repair shop and send someone over with a car with defects and rate the performance. So its one set of answers per report.
Based on the other
thread I revamped the class structure of the program. As I mentioned earlier, the questions for each client (importer) will be different. So I have a class called ReportTemplate which has a List of ReportParts, and they in turn have a List of QuestionGroups, which in turn have a List of Questions. Based on the earlier discussion I removed all that relates to answers and made a separate class called Report the instances of which will contain the answers. So Report has a reference to the relevant ReportTemplate and an ArrayList of Answers. When the report is filled out or shown, the parts and groups and questions in ReportTemplate are iterated through. I figured Report doesn't need a Map<Question, Answer> but an ArrayList<Answer> is sufficient and answers will be stored in the order of the questions in ReportTemplate (starting with ReportPart[0], QuestionGroup[0], Question[0]). This may change if need be, but for now I think this is sufficient.
So I think this class structure is ok now and it works fine for filling in and showing the reports. Also, saving the report in database and fetching it works. So when fetching a particular report, I'm going to get the instance of Report which references ReportTemplate and iterate through them as described.
As I said earlier, I'm very much a noob when it comes to ORM. I'm learning as I go. And since I have never used JasperReports, I don't really have an idea of how well it will work for this kind of report and which would be the easiest way of generating a pdf file of the report. So to be honest, I cant really say for now what I can and can't do with JasperReports and SQL.
I'm interested in all ideas as to which way to go. Then, based on any guidance I'll get here, I'll break out my books and guides and learn what I need. It's just that any pointers would be very useful so that I'll hopefully take off on the right path as I'm sure there will be quite a bit to learn and do to get the pdf generation done. For now, I have a working solution to print to pdf using PDFCreator and it produces fairly nice looking reports but it's not a convenient enough solution in the long run.