Jump to content
Changes to the Jaspersoft community edition download ×

subreport from a data source?

Recommended Posts

By: ali abd - yadh

subreport from a data source?

2002-09-05 15:27



I am trying to construct a subreport from a data source. The data that should be displayed in the subreport is already available in a vector of vectors. I have seen the example of subreport in the demo, which passes the connection to the database through the master report. In my case I will not need any connection. I will need to supply the subreport with data from a vector. How can we accomplish that?

Also, I still have a little misunderstanding how to simply display all the values of a vector into a report. Is it possible to have a for loop which goes up to the size of the vector and displays everything.


Thank you in advance.




By: Teodor Danciu - teodord

RE: subreport from a data source?

2002-09-06 01:58




You need to create custom implementations of the

JRDataSource interface to wrap your vectors if you

do not use normal JDBC data sources.

The subreport elements allow you to pass not only

a Connection object, but a JRDataSource object if

you wish (check the "QuickReference" to see the



You have to figure out yourself how to create such

a JRDataSource and how you wish to supply it to

your subreports.


The "datasource" sample is also a good example

even it does not deal with subreports.


Good luck!


Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...