Jump to content
We've recently updated our Privacy Statement, available here ×

Can I have jasper report with a subreport to a different ms sql database?


ahmy_1

Recommended Posts

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...