Jump to content

Problem with subreport data source?


donclary

Recommended Posts

I have a master report and three subreports that were created using iReport.  The master and subreports all work correctly when run from iReport.  The master report passes a LABELID parameter to the LabelSubreport to print a mailing label.  The master report and label subreport jrxml files are attached.

I am now calling the master report from a java app and the error below is generated by the first subreport.

Table LABELLIST is the list of mailing labels and does exist.  The LabelSubreport uses the same datasource as the Master.  I could not get the SubreportApp.java example to work, but seems to imply that the subreports need to be set up as parameters?

Any advice on the cause of my problem would be appreciated.

Thank you!

============================================================

Filling report...
Sep 13, 2008 4:07:37 PM net.sf.jasperreports.engine.fill.JRFillSubreport prepare
SEVERE: Fill 15312834: exception
net.sf.jasperreports.engine.JRException: Error preparing statement for executing the report query :

SELECT
     *
FROM
     "LABELLIST" LABELLIST
WHERE
     LABELID = ?


 at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createStatement(JRJdbcQueryExecuter.java:192)
 at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:123)
 at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:656)
 at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:588)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1196)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:833)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:782)
 at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:532)
 at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:63)
 at net.sf.jasperreports.engine.fill.JRThreadSubreportRunner.run(JRThreadSubreportRunner.java:209)
 at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: Table/View 'LABELLIST' does not exist.
 at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
 at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
 at org.apache.derby.client.am.Connection.prepareStatement(Unknown Source)
 at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:248)
 at org.apache.commons.dbcp.PoolingDriver$PoolGuardConnectionWrapper.prepareStatement(PoolingDriver.java:367)
 at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createStatement(JRJdbcQueryExecuter.java:162)
 ... 10 more
Caused by: org.apache.derby.client.am.SqlException: Table/View 'LABELLIST' does not exist.
 at org.apache.derby.client.am.Statement.completeSqlca(Unknown Source)
 at org.apache.derby.client.net.NetStatementReply.parsePrepareError(Unknown Source)
 at org.apache.derby.client.net.NetStatementReply.parsePRPSQLSTTreply(Unknown Source)
 at org.apache.derby.client.net.NetStatementReply.readPrepareDescribeOutput(Unknown Source)
 at org.apache.derby.client.net.StatementReply.readPrepareDescribeOutput(Unknown Source)
 at org.apache.derby.client.net.NetStatement.readPrepareDescribeOutput_(Unknown Source)
 at org.apache.derby.client.am.Statement.readPrepareDescribeOutput(Unknown Source)
 at org.apache.derby.client.am.PreparedStatement.readPrepareDescribeInputOutput(Unknown Source)
 at org.apache.derby.client.am.PreparedStatement.flowPrepareDescribeInputOutput(Unknown Source)
 at org.apache.derby.client.am.PreparedStatement.prepare(Unknown Source)
 at org.apache.derby.client.am.Connection.prepareStatementX(Unknown Source)
 ... 14 more
Exception in thread "Thread-3" net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Error preparing statement for executing the report query :
 

Link to comment
Share on other sites

  • 11 months later...
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • 4 weeks later...
  • 3 months later...

 "Caused by: java.sql.SQLException: Table/View 'LABELLIST' does not exist."

This is just part of the error report being generated by the code you just might not be able to create a table or view that does have the name you indicated in your query. To solve it just double check whether the table does really exist in your database if does then check the accessibility of it in your server, you might just be able to set a particular settings that causes limitation on the accessibility of the table/view.



Post Edited by colighto at 01/13/2010 10:47



Post Edited by colighto at 01/13/2010 10:47
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...