In some cases, we may have several datasources, with the same table structure.
And we would like run reports on any database.
An input control could be used for the user to choose which database he want to use.
See same demand : http://community.jaspersoft.com/questions/1005026/data-source-input-cont...
I just have the same problem; I want to execute an stored procedure wich is stored on different databases wich depends on a checkbox (or other inputControl). That inputControl should choose the datasource (not the database instead), and then maybe the database if's an option.
We re running a SQL Server, and the scenario is like we have a server storing present time data and a secondary historic data server; I cant use a Virtual Datasource with a Domain, cause this stored procedure calculates all data, and I can´t get it through Domain Language, only SQL statements.
I have the same request. I have a PostgreSQL Instance. In it, I will have N number of databases where the schema is the same for different organizations. When writing a report using the Jaspersoft Studio, you can select a datasource, input the parameters and run the report against different datasources. It would be nice to be able to do this same kind of thing once the report has been exported to some server and just pass the datasource as a parameter so we don't have to duplicate the report for each instance.
This could be achieved using data adapter resources instead of JRS data source references.
If you have the sample repository data shipped with JRS, you can see the report at /reports/interactive/CustomersReport.
It is a report unit that is not linked to a data source in the repository.
Instead, it references a data adapter resource using the following property in the JRXML:
<property name="net.sf.jasperreports.data.adapter" value="repo:/reports/interactive/CustomersDataAdapter"/>
This property could have an expression instead of hardcoded path, so you could point to a data adapter that you select with an input control in the UI, pass it through a parameter to the report and use it in the property expression.
This way you can pick the data adapter when you run the report and is like selecting a data source.
Note that data adapters are of many types, including JDBC connections and can be created with Jaspersoft Studio.
I hope this helps.