Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
passing domain objects as inputs for the report
RepBIRT
I have a list of domain objects and it has to be passed to the reports and display those records in the birt report as tables.
Any references or examples would be of great help.
Find more posts tagged with
Comments
JasonW
How are you running BIRT? Are you using the engine apis or the viewer?
Jason
RepBIRT
It is engine API's
JasonW
Are the domain objects in some type of java collection?
Jason
RepBIRT
Yes, something like this
Invoice invoice = new Invoice();
invoice.setInvoiceId(1);
invoice.setInvoiceMonth('1/1/2011');
List<Invoive> list = new ArrayList<Invoive>();
list.add(invoice);
The collection needs to be passed to the birt and displayed in the report(in the table format). Kindly let me know how to acheive this.
JasonW
When you create the task to run the report you can add your object like
task.getAppContext().put("myarrlist", list);
Then in the report access the list like:
var arrlist = reportContext.getAppContext().get("myarrlist");
To handle array list look at the attached report. I use a beforeFactory event to load it up, while you will be doing this in your api code.
Jason