how to pass JRTableModelDataSource as a datasource parameter to sub report

Is this the right approach to pass TableModelDataSource as parameter to subreport via master report

JRTableModelDataSource tds1=new JRTableModelDataSource(new CustomTableModel());
JRTableModelDataSource tds2=new JRTableModelDataSource(new CustomTableModel_sr());
  Map parameters = new HashMap();
  parameters.put("P_subreport_ds1",tds1 );
  parameters.put("P_subreport_ds2",tds2 );

The problem i am facing is when i create parameter for the above in ireport developer, it has datatypes of collections,array list or JREmptydatasource which does not fit for the above

and hence throws class cast exception..

 

Please suggest

 

evanspaiva's picture
Joined: Dec 3 2012 - 2:26am
Last seen: 10 years 4 months ago

0 Answers:

No answers yet
Feedback
randomness