madler Posted November 22, 2006 Share Posted November 22, 2006 I have an application which utilizes multiple data sources. The application is essentially a "Dashboard". There is a core application data store, which contains the data specific to the application, however there could be many other data sources used by the application to display data to the user. Although I know how to create definition files which will look at data contained within the application's own data store, it is impossible to determine ahead of time where these other data stores will be. Is it possible to specifiy a database connection string which is specific to a particular report definition file (e.g. for this report, this database is required, and this query is run on that database to retreive data for the report). Please let me know! Link to comment Share on other sites More sharing options...
lucianc Posted November 22, 2006 Share Posted November 22, 2006 You can use a custom report property for this:Code:<jasperReport ...> <property name="db.connection.string" value="..."/> ...</jasperReport> When you fill the report, you would do something likeCode:[code]JasperReport report = ...;String dbConnectionString = report.getProperty("db.connection.string"«»);Connection connection = createConnection(dbConnectionString);JasperPrint print = JasperFillManager.fillReport(report, params, connection); HTH,Lucian Link to comment Share on other sites More sharing options...
madler Posted November 22, 2006 Author Share Posted November 22, 2006 Let me give it a try. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now