pbrown Posted November 23, 2007 Share Posted November 23, 2007 Hello How can I use in the subreport another jdbc connection than in the masterreport? I've set up two jdbc connection in iReport:jdbcconnection1: connecting to an oracle dbjdbcconnection2: connecting another db The master report should use jdbcconnection1The subreport should use jdbcconnection2 My configuration uses always the same jdbc connection for master and subreport. How can I use different jdbc connection for the subreport? I tried "use another connection": $P{REPORT_CONNECTION}.This also seams to use jdbc connection from the masterreport. Can I specify here another jdbc connection? How? ThanksPost edited by: pbrown, at: 2007/11/23 06:09 Link to comment Share on other sites More sharing options...
JamieDenman Posted November 26, 2007 Share Posted November 26, 2007 Don't think you'll get an answer here mate. Have been trying to find this out for over 2 weeks now and nothing. The iReports documentation isn't any help either. Have tried every formation of connection string and alias I can think of and it will not accept anything. If it showed me the value it is placing in its built in connection parameter/variable that would help. Hope you have better luck than I have. Link to comment Share on other sites More sharing options...
momzilla Posted December 4, 2007 Share Posted December 4, 2007 The built-in parameter $P{REPORT_CONNECTION} gives a clue to what the app is expecting (java.sql.Connection). So make an iReport parameter to represent the OTHER connection/database you want the subreport to use. Then drop the $P into the subreport connection properties box. specifically in your main report that holds the subreport:[add-modify papameter/default value expression/new]parameter name: subConnSybase01DEVparameter class type: java.sql.Connectiondefault value expression: java.sql.DriverManager.getConnection("jdbcybase:Tds:localhost:49152/sybase01dev", "dba", "sql") [subreport/properties/subreport tab]Connection/Datasource Expression: Use connection Expressionpaste parameter in bottom box: $P{subConnSybase01DEV} **no clue how to turn off emoticons so the 'dizzy' is a colon sPost edited by: momzilla, at: 2007/12/04 02:27 Link to comment Share on other sites More sharing options...
pbrown Posted December 6, 2007 Author Share Posted December 6, 2007 Thank you! This information should be in the manual First I got an error that the driver class is unknown, but after adding another parameter of type java.lang.Class before, with value Class.forName( "odbc.oracle...") it worked fine.But is there a better place for this? Link to comment Share on other sites More sharing options...
FlexTech Posted January 28, 2008 Share Posted January 28, 2008 Finally i am happy to find someone who gives an right explanation how to use multiple Datasources an Ireport. Thank you very much...this is great. Link to comment Share on other sites More sharing options...
shib_best Posted August 27, 2014 Share Posted August 27, 2014 multiple connection working in ireport but when deployed in jasper server not getting records (gives the no data output) In main report I as using oracle data connection and in supreport I am passing postgre datasource connection as "use a connection": Set the Connection expression in subreport to: com.jaspersoft.ireport.designer.utils.Misc.getConnection("postgre") Now It is working in ireport viewer,but when deployed in jasper server the output shows as blank. can Anyone help. 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