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

Subreport closing connection?


raph

Recommended Posts

Hello all !

 

I am using JasperReports 1.3.1 and iReport 1.3.1.

I am having the following strange problem with a SubReport.

 

I have a main report that lists some information in the detail band. There is a group header/footer and on the footer, I want a little table that makes a summary of the current group (using a subreport). Then the next group gets printed with all the details and then another group footer containing the subreport.

 

The problem I am encountering is that when there is only I group (and therefore the subreport gets printed only ONCE), everything works perfectly. As soon as there are several groups, I get the following error when running the report :

 

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:99) at net.sf.jasperreports.engine.fill.JRFillDataset.advanceDataSource(JRFillDataset.java:842) at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:760) at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1078) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:111) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:751) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:660) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:402) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:234) at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:815) at java.lang.Thread.run(Unknown Source)

Caused by: org.firebirdsql.jdbc.FBSQLException: The result set is closed at org.firebirdsql.jdbc.FBResultSet.checkCursorMove(FBResultSet.java:217) at org.firebirdsql.jdbc.FBResultSet.next(FBResultSet.java:249) at net.sf.jasperreports.engine.JRResultSetDataSource.next(JRResultSetDataSource.java:95) ... 11 more
Print was not filled. Try using an EmptyDataSource...

 

The database I am using is Firebird.

Since it says "The result set is closed", the idea I have is that once the subreport prints the first time, it closes or unhooks the connection which means any subsequent attempts to rerun the subreport fail with the above error message.

 

Has anyone ever had this problem in the past?

 

I have bought the iReport manual, searched the newsgroups and even followed the flash tutorials on building subreports, but I seem to be doing everything right (I'm obviously not though, right?! ;) )

 

Thanks for your help,

Raphael

Link to comment
Share on other sites

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

Top Posters In This Topic

Hi!

I have the same problem (also firebird).

I haven't tried with "one group only", so thanks for pointing in this direction ...

I also found the following:

http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=&func=view&catid=8&id=5847#5847

 

 

It seems the query/statement needs to be kept open even after "commit" ... or after fetching the last result row, so it can be reused?

 

I'll try in this direction ...

maybe someone else has an idea?

 

Yours,

Sebastian

Post edited by: csbac, at: 2007/05/29 11:56

Link to comment
Share on other sites

  • 2 months later...

To fix the problem you should specified in the connection url defaultResultSetHoldable=True

for example

jdbc:firebirdsql:10.1.1.1:dbPath?defaultResultSetHoldable=True

 

I spent a lot of time searching for the solution, I hope this help a lot of people.

 

Camilo.

Link to comment
Share on other sites

Hi!

Thanks a lot, solved the problem ...

before, I patched the JasperReports code to open queries with HOLD_CURSORS_OVER_COMMIT ...

 

Unfortunately, I start running into other bugs ... stuff that worked on Monday, no longer works ... trying hart to find out what's going on ...

(Date parameter is set as String, but does not have Timestamp format ...)

 

Thanks,

Sebastian

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