k.Herkt Posted October 19, 2016 Share Posted October 19, 2016 I have a main-report with several sub-report.All sub-reports and the main-report are using the same connection, except ONE sub-report.I created 2 Data Sources on 'JasperReports Server', but i can only specify ONE data source for the main-report and its sub-reports.The "bad solution" for this is to manually add a second java.sql.Connection in the main-report.jrxml.But is there a more safe and dynamic solution, than doing this by hardcoding the db credentials?http://community.jaspersoft.com/wiki/multiple-datasources-ireport-lists-tables-and-subreportsThe "bad solution" in the main-report.jrxml from the provided link: <parameter name="MS_SQL_CONNECTION" class="java.sql.Connection" isForPrompting="false"> <parameterDescription><![CDATA[java.sql.DriverManager.getConnection("jdbc:sqlserver://SERVER_IP;databaseName=DB_NAME","USER_NAME","USER_PASSWORD")]]></parameterDescription> </parameter> Only one sub-report is using this MS_SQL_CONNECTION, all other sub-reports + the main-report are using the "primary" connection (PostgreSQL).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