Jump to content
Changes to the Jaspersoft community edition download ×

How to pass in all data

Recommended Posts

By: Justin - jwesbro

How to pass in all data

2003-12-10 09:02

If I already have a Collection of data that I want to use in a report, how do I pass that in instead of specifying a query in my report.


I looked for examples and searched the archvies, but couldn't find anything about this. Can some one point me to some info on this?





By: Teodor Danciu - teodord

RE: How to pass in all data

2003-12-10 11:59




All you have to do is to wrap your collection inside

a JRBeanCollectionDataSource.

Take a look at the "datasource" sample provided

with the project source files.


I hope this helps.








By: Ritesh - sharmaritesh

RE: How to pass in all data

2004-01-02 03:24

Actually..there is another way to do it...what i did is that i have my data in a databean say "ReportBean"...i put the object as a parameter and pass it to the runreport api...


HashMap parameters = new HashMap();

parameters.put("report", retData);


here "retData" is an instance of my data bean..having all my data..then...


JasperRunManager.runReportToPdf(<name of template>, parameters, <some dummy data source>);


in the report i get this parameter (named "report" while putting) and i can use the usual getter methods to get the data...


hope that helps

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