private JRBeanCollectionDataSource dataSource;
private MapString, Object parameters = new HashMapString, Object();
CollectionReportBean BeanList = createBeans();
dataSource = new JRBeanCollectionDataSource(BeanList);
//use parameters if the value doesn't change i.e.customer
name,account number,etc.
parameters.put(PROJECT_ID, project.projectID);
CollectionReportBeans createBeans(resultSet){
ListReportBeanList result = new ArrayListReportBeanList();
foreach (value in the resultSet ) {
ResultsReportBean Bean = new ResultsReportBean();
Bean.setType(Project); //i.e. prjoect or coverage
Bean.setId(Id);
etc, etc, etc
}
result.addAll(Bean);
JasperReport jasperReport =
JasperCompileManager.compileReport(templateFilename);
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,
parameters , dataSource);
JasperExportManager.exportReportToPdfFile(jasperPrint, reportFilename);
Thank you very much for your reply.
I dont expect spoon feeding. I try to kick start with the piece of code that
you provided.
--
View this message in context:
http://www.nabble.com/Multiple-Object-in-DataSource-Collection-tp25816344p25837848.html
Sent from the jasperreports-questions mailing list archive at Nabble.com.
--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
jasperreports-questions mailing list
jasperreports-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions