BIRT Exchange Forum: passing domain objects as inputs for the report - BIRT Exchange Forum

Jump to content


 

No Latest Open Poll.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

passing domain objects as inputs for the report Rate Topic: -----

#1 User is offline   RepBIRT Icon

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 91
  • Joined: 24-October 11


Posted 09 April 2012 - 10:47 AM

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

#2 User is offline   JasonW Icon

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 2505
  • Joined: 08-August 07


Posted 10 April 2012 - 06:49 AM

How are you running BIRT? Are you using the engine apis or the viewer?

Jason
0

#3 User is offline   RepBIRT Icon

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 91
  • Joined: 24-October 11


Posted 11 April 2012 - 12:09 PM

It is engine API's
0

#4 User is offline   JasonW Icon

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 2505
  • Joined: 08-August 07


Posted 11 April 2012 - 01:15 PM

Are the domain objects in some type of java collection?

Jason
0

#5 User is offline   RepBIRT Icon

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 91
  • Joined: 24-October 11


Posted 12 April 2012 - 07:58 AM

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

#6 User is offline   JasonW Icon

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 2505
  • Joined: 08-August 07


Posted 12 April 2012 - 11:12 AM

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

Attached File(s)


0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users