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

Unable to print main report with subreport


hahagal

Recommended Posts

Hi,

When previewed on the report, I encounter the following error. I am using subreports in the report, and using DB2 (JDBC connection) Is there any settings needs to be done?

 Error filling print... Unable to get next record.
net.sf.jasperreports.engine.JRException: Unable to get next record.      at net.sf.jasperreports.engine.JRResultSetDataSource.next(JRResultSetDataSource.java:95)      at net.sf.jasperreports.engine.fill.JRFillDataset.advanceDataSource(JRFillDataset.java:861)      at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:779)      at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1448)      at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:112)      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:923)      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:826)      at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:59)      at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417)      at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247)      at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:857)      at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)      at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)  Caused by: com.ibm.db2.jcc.am.SqlException: [jcc][t4][10120][10898][3.57.110] Invalid operation: result set is closed. ERRORCODE=-4470, SQLSTATE=null      at com.ibm.db2.jcc.am.bd.a(bd.java:660)      at com.ibm.db2.jcc.am.bd.a(bd.java:60)      at com.ibm.db2.jcc.am.bd.a(bd.java:103)      at com.ibm.db2.jcc.am.am.Db(am.java:4219)      at com.ibm.db2.jcc.am.am.c(am.java:314)      at com.ibm.db2.jcc.am.am.next(am.java:293)      at net.sf.jasperreports.engine.JRResultSetDataSource.next(JRResultSetDataSource.java:91)      ... 12 more 
Print not filled. Try to use an EmptyDataSource...
 
 



Post Edited by hahagal at 07/21/2011 14:36
Link to comment
Share on other sites

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

Just to also check if subreports can be placed in any section of the main report like Page Header, Column Header, Details and etc. I have tried to put the subreport in the Summary section and seems no error.

 

Link to comment
Share on other sites

Is your query string is making a call to a stored procedure?  If so, I notice you're passing two parameters to the procedure.  Have you tested the stored procedure in a SQL client to make sure what you're passing to the procedure will actually return something?

David

Link to comment
Share on other sites

Hi,

Yes, am using stored procedures. When I try to print the subreports individually, it is ok. If the subreport is putted at the summary section, it is ok as well. Only when the subreport is been putted at other section then will have problems.

Link to comment
Share on other sites

  • 9 months later...

I had this problem in one of our client sites.

After much searching we found an issue with IBM DB2 connections and isolation levels.

If you are withing Websphere and are using a datasource connection go to

Data Sources -> <Data source name> -> Custom Properties

Set the variable ResultSetHoldability to 1

 

If you are not using this, I believe you can:

1)  Use a Connection with auto commit set to false

2) use the IBM rather than generic driver

 

Hope this helps.

 

Link to comment
Share on other sites

  • 1 year later...

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...