Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Birt POJO's as DataSource?(predefined definitions used dynamically)
Birt POJO's as DataSource? [message #797195] Mon, 13 February 2012 01:50 Go to next message
Ludwig Moser is currently offline Ludwig Moser
Messages: 319
Registered: July 2009
Senior Member
Hello!

my aim is to use the DataModel of my application as source input for BIRT.
i hope i am able to explain what i want to do good enough so you can tell me how i can achieve this.

i got a data model with multiple classes.
1) how can i predefine the fields available for each class without having to write the rtplibrary for all my classes by hand (or in the editor where you put all the stuff together)? (do i have to write my own Class2XML converter?)

2) how can i give BIRT a list of objects as input data?
3) how can i tell BIRT to only show up data structure which is really used in input data? (means if i only have input for class PERSON it shall only display me PERSON as possible data source and not any of the others...)

it's okay if there is a lot of work to do to get this stuff working, but i want a clean dynamic way to solve this.

any help wellcome

thanks in advance.
Ludwig Moser

ps: i've been looking through vogella's tutorial on birt & POJO's
http://www.vogella.de/articles/EclipseBIRT/article.html
Re: Birt POJO's as DataSource? [message #798585 is a reply to message #797195] Tue, 14 February 2012 16:35 Go to previous messageGo to next message
zubin Missing name is currently offline zubin Missing name
Messages: 32
Registered: July 2009
Member
I am facing same issue. did you solve this already?
Re: Birt POJO's as DataSource? [message #798833 is a reply to message #798585] Wed, 15 February 2012 01:08 Go to previous messageGo to next message
Ludwig Moser is currently offline Ludwig Moser
Messages: 319
Registered: July 2009
Senior Member
not yet, but i have an idea, which i try to implement today (i will post here iff it works)
Re: Birt POJO's as DataSource? [message #800544 is a reply to message #798833] Fri, 17 February 2012 02:45 Go to previous messageGo to next message
Ludwig Moser is currently offline Ludwig Moser
Messages: 319
Registered: July 2009
Senior Member
ok, i finally worked it out with a test application (hardcoded)
i'll now create the api/libs for dynamic creation of the datasource from objects to report files.
pm me if you are still interested
Re: Birt POJO's as DataSource? [message #901059 is a reply to message #800544] Thu, 09 August 2012 11:00 Go to previous messageGo to next message
zubin Missing name is currently offline zubin Missing name
Messages: 32
Registered: July 2009
Member
Hi, ludwig

I am wondering if you solved this issue?

thanks,
Zubin
Re: Birt POJO's as DataSource? [message #901118 is a reply to message #901059] Thu, 09 August 2012 17:07 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Are you using the BIRT Viewer or the Report Engine API?

Jason

On 8/9/2012 11:00 AM, zubin Mising name wrote:
> Hi, ludwig
>
> I am wondering if you solved this issue?
> thanks,
> Zubin
Re: Birt POJO's as DataSource? [message #901122 is a reply to message #901118] Thu, 09 August 2012 17:25 Go to previous messageGo to next message
zubin Missing name is currently offline zubin Missing name
Messages: 32
Registered: July 2009
Member
I am using report engine api, but also open for the other optinos
Re: Birt POJO's as DataSource? [message #901126 is a reply to message #901122] Thu, 09 August 2012 17:28 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

If you are using the re api you can add any object to the engine by
using task.getAppContext().put("myobject", objectinstance);

Then in script get it like:

reportContext.getAppContext().get("myobject").callMyMethod();


Jason

On 8/9/2012 5:25 PM, zubin Mising name wrote:
> I am using report engine api, but also open for the other optinos
Re: Birt POJO's as DataSource? [message #901127 is a reply to message #901126] Thu, 09 August 2012 17:49 Go to previous messageGo to next message
zubin Missing name is currently offline zubin Missing name
Messages: 32
Registered: July 2009
Member
Thx for the quick reply, jason

Does that mean i can use this as data set in script?

for example:

var table = elementFactory.newTableItem(null, 3);
table.setProperty( "dataSet", reportContext.getAppContext().get("myobject") );



thanks,
Re: Birt POJO's as DataSource? [message #901595 is a reply to message #901127] Mon, 13 August 2012 11:06 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

No but you could create a scripted data source in your report and in the
data set open get the object and in the fetch method iterate it.

Jason

On 8/9/2012 5:49 PM, zubin Mising name wrote:
> Thx for the quick reply, jason
>
> Does that mean i can use this as data set in script?
>
> for example:
>
> var table = elementFactory.newTableItem(null, 3);
> table.setProperty( "dataSet",
> reportContext.getAppContext().get("myobject") );
>
>
>
> thanks,
Previous Topic:To create table detail cell/grid row dynamically based on dataset
Next Topic:Access the value of a computed column of a dataset in a script
Goto Forum:
  


Current Time: Sat Jul 26 01:08:45 EDT 2014

Powered by FUDForum. Page generated in 0.02376 seconds