frblusso Posted October 10, 2006 Share Posted October 10, 2006 Hello i have the problem below : i have a list of Planes. A plane contains text fields (id, name) and a list of flights(object B)Each flight has text fields f1, f2 ...; .I want to create a report to list all the Planes id ,names and flights details For example :plane1 A320 volAF volKLM volXXXplane2 A330 volAF volXXX i have created in my java programm a JRBeanCollectionDataSource(PlanesList) that have all the information it contains a list of (id, name ,flightList) but how could i put flightList detail information in the report? I think I have to use a subreport , the main report is used to generate the list of planes whith text fields id and name.In the subreport I list the text attibutes of one flight. The problem is that I do not know how to specify that the subreport needs to read (as its own datasource) the list flightList found in the main report. i search in the forum for any information but i only found a solution if the first list has only one object. i really need help, thancks! Regards Link to comment Share on other sites More sharing options...
frblusso Posted December 18, 2006 Author Share Posted December 18, 2006 I found this solution to my problem :i have a bean Avion (id, name, java.util.List flightlist)in the main report, I insert a subreport, with this property, use datasource expression new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{flightlist}) In Subreport(other) i put the path to the subreport.and in my java application, i have just to create the JRDatasource to give me the data Avion. regards Françoise Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now