cancel
Showing results for 
Search instead for 
Did you mean: 

How to close ReportClientDocument in Crystal reports for JAVA

Former Member
0 Kudos

We are using JAVA Crystal Reports to make WEB report (Oracle database) . Everything appears to the fine. However, we discovered a problem that the Crystal report makes dedicated DB connection each time when a report viewer is opened (with the help of

ReportClientDocument) this connection can be viewed in V$Session view.

The true problem is that the database entry remains open even if the report object is out of scope. If I close the ReportClientDocument before or after the report generation (viewer.dispose()) then the report will generate fine, but the report pagination would not work.

Our architecture is using Spring MVC (JAVA) with singleton service in the controller. Our question is how the DB connection can be closed with this type of architecture?

0 Kudos

I have the same issue, any solution ????????

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

shawn.penner I see the same issue in my application too. I see that my db connection is still not closed even after calling close on reportclientdocument. Is their a way i can force the connections to be closed after the crystal report is rendered/closed?

former_member203619
Contributor
0 Kudos

The crystalreportviewer requires the reportclientdocument object to be active and available in order for page navigation to work. There is no way around that. In addition, depending on how the report was viewed (if you allowed it to prompt for parameters), the viewer may have a reference to the reportclientdocument object - which would mean it cannot be closed until the viewer is disposed of.

Lastly, the report engine uses database connection pooling - but if you close/dispose of the reportclientdocument object, you should see the database connection close after a short while - it will generally not close immediately.

If you want to be able to view the report and close the reportclientdocument object, I recommend you export to PDF and view that.

Shawn