Re: [jasperreports-questions] Multiple Object in DataSource Collection

2009-10-10 Thread harishsyndrome



 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


Re: [jasperreports-questions] Multiple Object in DataSource Collection

2009-10-10 Thread harishsyndrome

Novice requires some more clarifications.

Having Chris's Idea running in parallel. I would like put my question in a
different way.

In JRXML

field name = projectId class = java.lang.Integer
field name = coverageId class = java.lang.Integer

Is there any way that i can mention
projectId belongs to the class Project
coverageId belongs to the class Coverage

??
-- 
View this message in context: 
http://www.nabble.com/Multiple-Object-in-DataSource-Collection-tp25816344p25840895.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