views:

43

answers:

1

Hello, I'm using JasperReports and I'm using the provided JRBeanCollectionDataSource class to wrap a List of beans. Everything works fine in my reports when I'm accessing a simple property of the bean, but what I really need to do is access a few methods on the class. For example I would like to access the method:

public List<Date> getCertifications(Date postedBy);

How would I go about accessing this in the JRXML (or iReports)? If I define a field such as

<field name="certifications" class="java.util.List"/> 

then I get an error that the property is unknown.

Thanks for the help!

JasperReports: version 3.7.3

A: 

What date will you pass? I think, with JRXML you can only define bean properties - i.e. the ones that have a standard setter and getter. Everything else you can invoke from expressions.

Bozho
The date is a parameter to the report. That part I have figured out. How would I use an expression to access the current object that the report is using? i.e. how would I call getCertifications( new java.util.Date() ) from a textFieldExpression if getCertifications( Date ) is a method on a PersonBean and the report's datasource is a Collection of PersonBeans? Thanks.
Josh Z