Jump to content
We've recently updated our Privacy Statement, available here ×

Passing parameters to JavaBean datasource


stefankesseler

Recommended Posts

 Hello.

 
I am new to JesperReports and after doing some basic reports I am now facing a more complex task.
 
The data to run a query on is distributed over monthly tables (one for August, one for September and so on). It seems to me that a regular SQL-query won´t help here when a time period is freely selectable.
 
So my idea was to write my own JavaBean datasource (based upon the SampleJRDataSourceFactory), pass parameters to it (e.g. the time period) and run a query on those tables affected. Accidentially I have not found a way to pass parameters to this Factory.
 
My questions basically are:
 
- is there a way to pass parameters over to the JavaBean
 
- is there another way to solve this problem.
 
Thanks for all your help :)
 
Greets
 
Stefan
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

 

When you are using JavaBean datasource, i would suggest to run your query in java layer only and set the the data in java bean itself. Then this data set you can map in reports and iterate. Make sure to wrap your list/collection in java bean to JRDataSource data type.

Link to comment
Share on other sites

  • 5 years later...

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