views:

2288

answers:

3

So I do now have my working and filling reports. The users of my program can now pass objects from the program to a report object and fill it using the JRBeanCollectionDataSource and that does work. However I can't get all the data in the report I want. I am just very confused about this, how the fields that I declare with a name and a Class map to the properties of the beans in my collection.

I have a hibernate persistent object called Item

Item has a List properties

and property is a table that holds a name, type and value (all more persistent objects).

I need to show on my reports not just properties of the beans but properties of beans that are in List collections of other beans. I am using iReport to build reports and I can do JavaBeanDataSource as well as HQL, but since when the report runs, it's going to have a collection of beans to be filled with, but I need to get only certain elements of the collection depending on criteria, needing to display fields on my report such as :

properties.value where properties.name = 'foo'

where properties is a collection property of the bean in my data source, basically having a query that queries the data in the Bean as my field, and even to be able to create a sub-report listing out the properties that are in the collection that is the property of the bean.

Any help and direction is much appreciated, thank you very much!

Joshua

+2  A: 

I have finally found at least a lead on the answer, though I don't have it working yet.

http://knol.google.com/k/nasir-qureshi/jasper-reports-working-with-beans-and/3az55pmbwf6s/3

This is basically exactly what I'm doing, except I want to embed the subreport in the report and I want to make reports that show some of the elements of the List based on criteria.

Joshua
You should select your answer as the "chosen" answer.
Nemi
+1  A: 

What IDE you use?Do you know about iReport?I think it may help you

Argiropoulos Stavros
I am using eclipse and also have iReport which I had to compile to get to connect to my AnnotationConfiguration. I am very close now, Iam able to embed the subreport in the report, passing to as it's DataSource a new JRBeanCollectionDataSource and use it. However I'm not able to apply logic to that, and get at only some results.
Joshua
+1  A: 

This is not resolved I guess. Otherwise please update here with the solution.

I faced similar issue with iRerport 3.7.0 I logged a bug at

http://jasperforge.org/plugins/mantis/view.php?id=4480

I also followed Nasir Qureshi's blog

http://knol.google.com/k/jasper-reports-working-with-beans-and-sub-report#

I have asked this question on the blog as well. Till then if somebody knows the answer, please let me know.

Nayn
The original question is still not clear to me, can you ask another question and be more specific with code or real life example
medopal
Could you please ask specific question about what are you unclear on. I can give objective inputs.FYI: I have solved the issue by manually editing jrxml.
Nayn
The link that I mentioned have complete details about the problem>> http://jasperforge.org/plugins/mantis/view.php?id=4480
Nayn