Jump to content

Passing Objects as Parameters


2005 IR Help

Recommended Posts

By: Osian (The Welsh Wizzard) - osian

Passing Objects as Parameters

2004-11-09 02:03

Hi all,

 

I am currently looking at moving over to Jasper from ReportMill, but I have a couple of things I need to verify.

 

Within my application, I retreive objects which have relationships to other objects e.g. a Sales Order object will know about a depot object and a contract object. The question is, is if I have my SalesOrder object, can I pass this in as a parameter to the report so that I dont have to go and write big complex SQL statements to be executed on a db?

 

The setup that we have is that we are using WebObjects, so if anyone has any advice then please let me know. Also, any example code would be greatfuly appreciated e.g. can we use the Model within EOModeler as the datasource?

 

Regards,

Osh

 

 

 

 

By: Mykel Alvis - evilarchitect

RE: Passing Objects as Parameters

2004-11-11 09:46

Using a locally cached object, assuming that you aren't doing any lazy initialization, you should be able to pass the object to the report as long as the definitions for the object are available to the report at compile time. You'll have to cast the object, so there must exist a class (at compile time of the report) that is the class of the object you want to pass. Runtime discovery is currently a little complex for a tool like jasper.

This might be an issue with you using WO. Writing late binding for dependent objects could cause issues. You'll probably need a specifically flattened dataset and read from that.

 

Specifically, I still think a custom datasource that reads a flattened model (it's readonly data anyway) is the simplest route to go.

Link to comment
Share on other sites

  • 2 years later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

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...