JDBC datasource switch based on query params

0

Hi,

Just wondering can one switch or choose the JDBC datasource a report uses to generate data based on query params? 

I have a use case where one single report template is requried, but coud point at several datasources. I would like to be able to do the report without having to make several copies of the same template hardcoded to use a speciific data source. 

Best,

Mark

markwilliamson101's picture
Joined: Feb 23 2017 - 8:45am
Last seen: 2 years 5 months ago

2 Answers:

1

If this is in the server, you might be able to use attributes:

http://community.jaspersoft.com/documentation/tibco-jasperreports-server...

However, you can't use report parameters in the query, because the datasource is loaded before parameters.

elizam's picture
4016
Joined: Mar 5 2012 - 9:19am
Last seen: 2 weeks 2 hours ago
1

If you are programming, you can just dynamically set the datasource to pass to the report. That's what I do.

hozawa's picture
47007
Joined: Apr 24 2010 - 4:31pm
Last seen: 2 months 1 week ago
Feedback