jasemilly Posted December 15, 2011 Share Posted December 15, 2011 Hi I am trying to create a report that contains a subreport with a different data source. I am struggling in achieving this. In my master report I have created a parameter calledSubDataSource with a parameter class of java.sql.Connection Default value expression of net.sourceforge.jtds.jdbc.Driver("jdbc:jtds:sqlserver://192.168.0.144/DW","sa","area51") when I work throught subreport wizard, I select use another connection for the datasource and populate it with the SubDataParameterthe report fails to preview and I have attached the log. what am I doing wrong??? I have a datasource called DW and the value expression is copied from there. Is it possible to display the value of REPORT_CONNECTION, I could then display what the correct format for this value should be.thanksJasemilly Link to comment Share on other sites More sharing options...
jasemilly Posted December 15, 2011 Author Share Posted December 15, 2011 I have changed the value expression to java.sql.DriverManager.getConnection("jdbc:jtds:sqlserver://192.168.0.144/DW","sa","area51") But I am been told, Caused by: java.sql.SQLException: No suitable driver found for jdbc:jtds:sqlserver://192.168.0.144/DW how can I have no suitable driver when I only connect to a sql db and use this driver. Link to comment Share on other sites More sharing options...
augarte Posted December 15, 2011 Share Posted December 15, 2011 Hi, I think you have to add the driver to the iReport. At least this is what I did the first time I worked with a sql connection. First of all download the correct sqljdb.jar and then follow this steps: In iReport, go to Tools->OptionsIn the CLASSPATH tab, select "Add JAR" and add the file you have previously downloaded. Hope this helps. Regards Link to comment Share on other sites More sharing options...
jasemilly Posted December 15, 2011 Author Share Posted December 15, 2011 Hi I have added the jar file to the classpath. I have a few enteries for the jtds jar file, as after much reading in the forum. It seems that this problem is encountered often.I found a few enteries regarding the JAR file needing to be in certain folders so I created the folders or copied the files straight to the folder and created an entry in the class path? Some people seem to have this working and some people really seem to struggle. will the same file referenced in different folders in the classpath cause a problem? I find the missing driver error very strange since I have only ever used this driver and have lots of reports all working.feel I am very close to solving this but at the same time feel it feels along way to go. thanksJase milly Link to comment Share on other sites More sharing options...
lsotomty Posted December 20, 2011 Share Posted December 20, 2011 Hi, I have the same problem, has anyone found the solution? 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