evelina Posted December 17, 2009 Share Posted December 17, 2009 I want to use different datasources for main report and for subreport. As far as I have read this could be configured by specifying Connection Expression / Data Source Expression in the subreport properties.I have tried the following expressions:1. For connection expressiona) java.sql.DriverManager.getConnection("jdbc:mysql://localhost/mydatabase?user=root&password=root")I have recieved the exception:Error evaluating expressionCaused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/mydatabase?user=root&password=root b) it.businesslogic.ireport.util.Misc.getConnection("MySQL")I have recieved the exception:Error evaluating expressionCaused by: groovy.lang.MissingPropertyException: No such property: it for class: MainReport2_1261053872640_197936 2. For Data Source expressiona) com.jaspersoft.ireport.designer.utils.Misc.getDataSource("MySql")I have got no exceptions though the subreport was not displayed at allb) it.businesslogic.ireport.util.Misc.getJRDataSource("MySQL")I have recieved the exception:Error evaluating expressionCaused by: groovy.lang.MissingPropertyException: No such property: it for class: MainReport2_1261058321687_913089 I use iReport 3.6.1, Java: 1.6.0_06; Windows XP.mysql-connector-java-5.1.10-bin.jar is listed in the classpath. Could you please advice? Link to comment Share on other sites More sharing options...
dolfandringa Posted February 21, 2010 Share Posted February 21, 2010 I am having he exact same problem here in ireports 3.7.1. When I select "Use a connection expression" with $P{REPORT_CONNECTION} (just to test), the report and subreport work fine. But if I try to specify the connection of the subreport with any of the options that evelina tried, the subreport is empty, even if the strings for getJRDataSource and getConnection are in fact the same as for the master report.I am wondering where the it.businesslogic.ireport.util.Misc class should reside. I guess the error means iReports can't find it.Did you find out a solution evelina? Or does anyone else have one?Cheers,Dolf.Post Edited by dolfandringa at 02/21/2010 21:58 Link to comment Share on other sites More sharing options...
mayoukane Posted May 9, 2012 Share Posted May 9, 2012 Hello every body To use multiple datsource in report you have to use use this com.jaspersoft.ireport.designer.utils.Misc.getConnection("<connection_name>") Link to comment Share on other sites More sharing options...
kavita.negi Posted October 13, 2013 Share Posted October 13, 2013 while using com.jaspersoft.ireport.designer.utils.Misc.getConnection("") connection expression the reports are empty Link to comment Share on other sites More sharing options...
mrambinintsoa Posted September 11, 2014 Share Posted September 11, 2014 when i use this connection expression, i get the error message : "too many connections ... " ... any advice please? Link to comment Share on other sites More sharing options...
Scott Andersen Posted June 14, 2022 Share Posted June 14, 2022 Here is a WIKI article that my provide a possible solution:https://community.jaspersoft.com/wiki/jaspersoft-report-using-two-separate-data-sources 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