title: JasperReports: Passing in a list of lists as a datasource
body: <p>I need to populate a few subreports with lists of different objects. Basically lets say i have the following:<br/>
  Subreport on used Vehicles<br/>
  Subreport on new Vehicles<br/></p>
  
  <p>I create a vehicle bean class with variables as strings and create getter and setter methods for the same. Then in my datasource I pass in a <code>List&lt;List&lt;String&gt;&gt;</code> as detailRows. detailRows contains a list for new vehicles and a list for used vehicles. So lets say, i pass detailRows in the data source.<br/>
  Question is how do i pass these two lists to the two sub-reports? Can i use 
  <code>new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{newVehiclesList})</code> as a datasource for sub report 1 and 
  <code>new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{usedVehiclesList})</code> as datasource for sub report 2?<br/>
  Is there anything else that needs to be done apart from what i mentioned? Do i need to create and pass any variables? Is the appropriate use of the list of lists as i have listed above or is it <code>$F{detailRows}.get(0)</code>?</p>
  
  <p>I created a field detailRows in the main report as type list. I then pass the following to the subreport data source expression, <code>new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{detailRows}</code>
  Is there any way i can pass the <code>newVehiclesList</code> from detailRows to the sub-report?</p>
  
  <p>Thanks!</p>