ahmy_1 Posted November 28, 2017 Share Posted November 28, 2017 I need to make a report with data from two different queries which are from two different ms sql databases is there a way to make this and put it in a server? Link to comment Share on other sites More sharing options...
santhosh.devadurga Posted November 29, 2017 Share Posted November 29, 2017 Yes, it can be done by using subreports. While adding a sub report it will ask for a connection, instead of selecting "Use same JDBC connection used to fill the master report" select "Use another connection" and provide the expression to your required DB. Sample expression : java.sql.DriverManager.getConnection("jdbc:oracle:thin:@"+$F{SERVER}+":"+$F{PORT}+"/"+$F{SERVICE}, $F{USERNAME},$F{PWD})Hope it will resolve your problem. Link to comment Share on other sites More sharing options...
santhosh.devadurga Posted November 29, 2017 Share Posted November 29, 2017 Yes, it can be done by using subreports. While adding a sub report it will ask for a connection, instead of selecting "Use same JDBC connection used to fill the master report" select "Use another connection" and provide the expression to your required DB. Sample expression : java.sql.DriverManager.getConnection("jdbc:oracle:thin:@"+$F{SERVER}+":"+$F{PORT}+"/"+$F{SERVICE}, $F{USERNAME},$F{PWD})Hope it will resolve your problem. Link to comment Share on other sites More sharing options...
CaPsLoCkEr Posted November 29, 2017 Share Posted November 29, 2017 Hello You can also use a subdata set in the same report. This allows you to use another query on another database in the same report. Look at this tutorial:https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v640/datasets-and-subdatasets 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