Nested object properties and iReport fields

By: Quique - guacamato
Nested object properties and iReport fields
2004-06-28 09:46

I am creating a report where my fields are properties from a Java class. But as I used nested properties, the report doesn't compile, because of the way iReport tries to compose the name for the field:

dori.jasper.engine.JRException: Errors were encountered when compiling report expressions class file: C:\iReport-0.3.0\ ';' expected private JRFillField field_embalaje.codEmbalaje = null;

How can I declare fields that have to be populated from a nested property (like object.object.code, for example)?

Thanks in advance,
Enrique Medina.

By: Giulio Toffoli - gt78
RE: Nested object properties and iReport fields
2004-06-29 02:47

you can do something expressions like this


In this case Person field is declared simply as java.lang.Object


By: Quique - guacamato
RE: Nested object properties and iReport fiel
2004-06-29 09:18
Hi Giulio,

But then, I get an error that "" does not exists.

So I have to include in the classpath my classes, haven't I?

Enrique Medina.

By: Juan Ara - fi2net@Spain - laureke
RE: Nested object properties and iReport fields
2004-06-30 00:38
You need your clases in classpath.
If you're using iReports for several apps you can create a bacth file for each app, adding classpath of the app to the batch file (preventig heavy classpath load, since iReports copies classpath classes to his "work" directory).

You can access your properties as usual:


You can also declare variables to make it easy to maintain:
variable person type org.sample.MyPerson initiall value new MyPerson()
value $F{person}
Calculation group "persons"

And don't forget set up calc. times on the report.
2004 IR Help's picture
Joined: Aug 17 2006 - 3:49am
Last seen: 16 years 9 months ago

0 Answers:

No answers yet