I've been having loads of problems trying to get a Spring/Hibernate web application to generate Jasper Reports. I have a model populated as a HashMap and the report will display the single entries fine: language, format, date, etc. by getting a parameter that corresponds with a key in the model e.g.
model.put("language", "en"); - java
<parameter name="language" class="java.lang.String"/> - .jrxml
$P{language} - in iReport
I have tried putting the data in the model as a JRDataSource object, an Array, and a Collection but it simply won't work. I put the data in the Detail section of the report and nothing is displayed. But if I put the data in any other section the first entry is displayed, so I know the information is there.
Curiously even when I put static text in the Detail section it still appears blank. Of course when I query the database directly or connect with hibernate it will work but I need to get the Bean data from the model.
What is the right way to make Jasper Report display this information?
I tried for hours to get iReport 3.6 to connect to my JavaBeans set DataSource but it keeps giving me errors. My colleague said it is not necessary to connect iReport though.