Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Matilda Hughes   on Aug 29 In Java Category.

  
Question Answered By: Julian Long   on Aug 29

You must pass your ArrayList of object to jasper  as a JRBeanCollectionDataSource:

JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(list);
jasperPrint = JasperFillManager.fillReport(jr, reportParameters, ds);

Then in the JasperReport you refer to the object’s properties or methods, in an OGNL type manner. For example, to access the name property of an employee object within list objects, use:

employee.name

OR to reference a property called name within the list objects:

name

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on how to print an arraylist using jasper report? Or get search suggestion and latest updates.


Tagged: