DataSource in main rpt, Connection in subrep

By: bst05 - bsharp05
DataSource in main rpt, Connection in subrep
2005-12-21 06:34
Hi,

I have a report with a Hibernate Datasource (ArrayList of objects) in the main report. This works fine. Now I need to create a subreport within this report, but would like to create it using a connection instead of passing another array list through the parameters. I want to do this because it would just make things a lot easier and less complicated. However, is this possible?? If so, how would i go about implementing this?

Thanks,
Aditya.




By: David Heffelfinger - heffel
RE: DataSource in main rpt, Connection in subrep
2005-12-21 07:53
The way to do this is to pass the Connection object as a parameter to the parent report, then pass it along to the subreport by using the connectionExpression attribute of the <subreport> element.

David




By: bst05 - bsharp05
RE: DataSource in main rpt, Connection in subrep
2005-12-21 09:02
Thanks!

Works as expected. I thought initially that we could not pass in a connection as a parameter because it's not listed as an available parameter type in jasperassistant.

Aditya
2004 IR Help's picture
Joined: Aug 17 2006 - 3:49am
Last seen: 17 years 1 month ago

1 Answer:

Could you please provide an example of this?
mattcvincent's picture
Joined: Dec 5 2006 - 1:40am
Last seen: 16 years 10 months ago
Feedback