Symptom
When viewing a report using CR for Java, the report object is not cleaned up right away.
Resolution
To clean up the report, use the following code in your cleanup page:
<%@ page import="com.crystaldecisions.report.web.viewer.CrystalReportViewer"
%><%
CrystalReportViewer crystalReportViewer;
Object reportSource;
reportSource = session.getAttribute("ReportSource");
crystalReportViewer = new CrystalReportViewer();
crystalReportViewer.setReportSource(reportSource);
crystalReportViewer.dispose();
%>
Some ways to have a clean-up page called are:
- Have this page called when a new report is requested, to clean up any previously viewed reports
- Create a 'Logoff' button, that the user clicks that posts to this page
- Wrap the viewer in a Frame, or create a hidden Frame, that on page unload events invokes JavaScript that calls this page
- Put the code in a HTTP Session Listener instance registered with the web application to listen for HTTP Session timeout events.
For more details, see this blog posting:
http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/11649
Keywords
KBA , BI-DEV-JAV , BI Software Development Kits (SDKs) - Java , Problem
Product
SAP Crystal Reports XI R2