Start New Discussion within our Software Development Community

Hey guys, not sure what thread to put this in, please direct me to the correct one if this one isn't it.

I'm struggling with a sub report in iReports.

I have a report that selects from a MSSQL database, and uses a sub report to do a select from a MySQL database. I've successfully done it the other way around(report selects from MySQL, sub report selects from MSSQL), but doing it this way around has me stumped.

This is how I'm doing it currently:
Main report(just the sub report tags, let me know if I need to post more info about the main report. I replaced some of the variables, my work requires me to):

				<reportElement x="360" y="0" width="100" height="20"/>
				<subreportParameter name="ID">
				<connectionExpression><![CDATA[java.sql.DriverManager.getConnection("jdbc:mysql://<ip address>:3306/<db name>","<username>","<password>")]]></connectionExpression>
				<subreportExpression class="java.lang.String"><![CDATA["repo:/Enterprise/jrxml/Candidates/report1_subreport1.jrxml"]]></subreportExpression>

The error I am receiving:

Error filling print... Error executing SQL statement for : report1_subreport1 
net.sf.jasperreports.engine.JRException: Error executing SQL statement for : report1_subreport1     at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(     at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(     at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(     at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(     at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(     at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(     at net.sf.jasperreports.engine.fill.JRFiller.fillReport(     at net.sf.jasperreports.engine.JasperFillManager.fillReport(     at net.sf.jasperreports.engine.JasperFillManager.fillReport(     at     at org.openide.util.RequestProcessor$     at org.openide.util.RequestProcessor$ Caused by: Invalid object name 'tCandidate'.     at     at     at     at$PrepStmtExecCmd.doExecute(     at     at     at     at     at     at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(     ... 11 more 
Print not filled. Try to use an EmptyDataSource...

Please let me know if I need to give any more information, and please, if you know what I'm doing wrong, help me out. This has stumped me for 2 days now.

This article has been dead for over six months. Start a new discussion instead.