views:

469

answers:

1

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.

A: 

If anyone else has this problem I downgraded to iReport 3.5.1 and it worked. My application uses spring 2.5 and the newest version of iReport apparently has some compatibility issues.

Note using "compatibility mode" in the most recent version of iReport is not enough, you have to install an older version, 3.5.1 worked for me.

RobbR