Skip to Content
avatar image
Former Member

Report.Close() Hangs in TS Environment Only

We have an enterprise application that includes code to export Crystal Reports to PDF files in the user's own custom folder. This application works fine when running on a regular Windows PC. This same app is deployed to a Windows Server 2008 R2 Datacenter Terminal Server. When the app runs in this environment the report exports to PDF and then when attempting to free the resources by calling ReportDocument.Close() the program hangs.

1. Logging was introduced which nailed this down to the execution of ReportDocument.Close(), so it isn't custom code that is failing.

2. Crystal Runtime (13.0.2000) was uninstalled and reinstalled on the TS client without resolution.

3. The original report was quite complex, so this was replaced with a blank report with no connection to a data source, but even this blank report hangs when trying to run ReportDocument.Close()

4. It works on a range of OS's including Windows XP, 8.1, Server 2012, but not on the Terminal Server running Server 2008 R2 or 2008.

Any suggestions where to start looking? I've looked up similar posts, but these don't seem to be relevant (eg no custom UFLs)

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Apr 15, 2016 at 07:01 AM

    Some further investigation reveals the following:

    5. CrystalReportViewer object is also used in the solution and loaded up with 2 reports on 2 tabs. The Temp report copies that the report engine creates are located in the user's AppData folder "c:\Users\UserName\AppData\Local\Temp\34\". When closing down the ReportViewer object, the first report's temp files are all deleted and the ReportViewer hangs while trying to close the last report. This indicates to me that there is NOT a permissions issue with the Temp files.

    6. This is happening with the ReportEngine object AND the ReportViewer object.

    7. This may NOT be Terminal Server (TS) related, but OS related.

    Running out of ideas...it really looks to be a Crystal Report Engine issue.

    Add comment
    10|10000 characters needed characters exceeded