Importing java objects into report [message #261006] |
Fri, 09 November 2007 08:44  |
Eclipse User |
|
|
|
Originally posted by: abelo.telecable.es
Hello,
is there any way of injecting java objects (or collections) into a report?
For example, I have a table of people in my report with columns:
| Name | Address | Email | Phone Number |
----------------------------------------
And I have a java class like this:
class Person {
private String name;
private String address;
private String email;
....
Can I import a java.util.List<Person> into the report to build the
table, or I have to setup a scripted dataset?
Thanks in advance.
|
|
|
|
|
|
Re: Importing java objects into report [message #263088 is a reply to message #263085] |
Tue, 11 December 2007 14:48  |
Eclipse User |
|
|
|
Originally posted by: johnw.innoventsolutions.com
Andrew,
I wrote a few articles on how to do something similar using scripted
data sets:
Scripted Data Set to call a Web Service
http://digiassn.blogspot.com/2006/10/birt-scripted-data-sour ce-to-call-web.html
Scripted Data Set Serialized POJOS
http://digiassn.blogspot.com/2007/12/birt-passing-serialized -objects-as.html
If you are gnerating those objects on the fly, you can use a regular
scripted data set. If you are generating them in another program, you
can either serialize them like shown in the second example, or feed them
into BIRT using some sort of IPC mechanism.
John
Andrew Bytheway wrote:
> I am looking for a way to generate a report based on the values
> contained in a collection of Java objects. For example:
>
> Class Data{
> int height = 3;
> int width = 54;
> int depth = 19;
> }
>
> Height Width Depth
> ------ ----- -----
> 3 54 19
>
> Simple. Right?
>
> I've followed some leads in this newsgroup that suggest that this is
> possible, but so far, I have not been successful.
>
> Can anyone post code showing how to do this?
>
> Thanks in advance,
>
> Andrew Bytheway
>
|
|
|
Powered by
FUDForum. Page generated in 0.04257 seconds