Jump to content
Changes to the Jaspersoft community edition download ×

How to access custom java instances as fields


2004 IR Help

Recommended Posts

By: venkatr - venkatrt77

How to access custom java instances as fields

2005-03-17 07:33

Hi,

 

I am trying to make a pdf jasper report of orders submitted by users. The order contains header, line items and footer. I am populating the order information in a java object after querying from DB. The order object contains an address object for bill-to address. In the report, I am able to map fields to order object fields but not to fields in address object in order. In other words, a string field 'order.title' can be declared but could not declare 'order.address.street'. I tried creating a dynamic report too but i get an error saying cannot declare fields of custom classes, instead declare as 'java.lang.Object' which again gives type cast issues. I want to prevent creating new classes for report alone and trying to use the same object. It would be of great help if you can let me know of solutions if you have encountered any such problem.

 

Thanks in advance,

Venkat.

 

 

 

 

By: macoute - macoute

RE: How to access custom java instances as fields

2005-03-17 07:50

I don't understand exactely your problem, but fields name

don't have a point in their name.

If it is your problem, I've resolve it by declaring a dictionary

in order to map fields name (with '.') to wild card name.

 

 

 

 

By: venkatr - venkatrt77

RE: How to access custom java instances as fields

2005-03-17 13:10

Scenario is : I am passing a collection of 'Order ' objects to the jasper engine from my servlet. Each 'Order' has 'Address' instance as an attribute. I need the report to access the address attributes of each order. How to declare 'Address' attributes as fields in the xml. Is it possible to achieve the same.

 

 

 

 

By: macoute - macoute

RE: How to access custom java instances as fields

2005-03-21 01:30

You want to use a field name such as "Order.Address" as a field name.

It's not possible due to the '.' character, use" OrderAddress".

But you must resolve the mapping between "Order.Address" and "OrderAddress" in your custom datasource.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...