Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I get data from a POJO (Plain Old Java Object)?

Data Java object plain pojo
0
10 Posted

How do I get data from a POJO (Plain Old Java Object)?

0
10

This can be done using the scripted data set element. Let’s take an example: exposing an org chart as a data set. Let’s assume that the org chart is represented by a tree, and that the report wants to present this data in the form of, say, a phone list. We’ll need to write some “glue” code to link the POJO to BIRT. Next, we need to identify the right element within the design to hold the glue code. In this case, since we’re creating a data set, we’d choose a “scripted data set.” Then, we work out exactly what the glue code needs to do. The scripted data set has four methods: describe, open, fetch and close. Let’s suppose that the open method will get a handle to our org chart, perhaps by calling a factory method exposed in Java. JavaScript has an import statement that creates a bridge to our Java objects. So, we’d import, say, the factory class and the “org chart node” class.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.