SAP Knowledge Base Article - Public

1464735 - How do I clean up the viewer when viewing a report using CR for Java


When viewing a report using CR for Java, the report object is not cleaned up right away.


To clean up the report, use the following code in your cleanup page:

<%@ page import=""
CrystalReportViewer crystalReportViewer;
Object reportSource;
reportSource = session.getAttribute("ReportSource");
crystalReportViewer = new CrystalReportViewer();

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:



KBA , BI-DEV-JAV , BI Software Development Kits (SDKs) - Java , Problem


SAP Crystal Reports XI R2