Skip to Content

Application crashes on ReportDocument.Close()

I have read other threads about the same issue but unfortunately it didn't help me.

Basically my code is as follows:

Dim rd As New CrystalDecisions.CrystalReports.Engine.ReportDocument<br>rd.Load(txtReportPath.Text)<br>... enumerate the rd.ParameterFields collection ...

And the application hangs at rd.Close()

The report is completely empty, no database connection, no formulas, no parameters, nothing. Except for one text object to display the word "test".

We are using SAP Crystal Reports runtime engine for .NET Framework (32-bit) The (test-)application is 32-bit, target framework .NET 4.5.2, and runs on Citrix terminal server / Windows 2012 R2 Standard.

When I run the same test-application on a file server from the same customer it works fine. I have asked the system admin to reinstall the above mentioned Crystal Reports runtime, to no avail.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 24, 2018 at 05:42 PM

    Interesting... So it looks to be a Citrix issue.

    Likely permissions or resources.

    You'll have to ask the Citrix Admin to use ProcessMonitor and see what is different.

    I've seen this happen between Debug runtime and release runtime, different versions used in debug mode. But I have never heard of issues between VB and C#.... It could be something to do with the JIT compiler, hard to say without debug info.

    DebugDiag may capture more details as well.


    Add comment
    10|10000 characters needed characters exceeded

  • Apr 18, 2018 at 01:55 PM

    Changed tag to CR for VS,

    Try SP 22, there was an issue with the viewer, not that you are using it but it is the latest.

    Try 4.6 framework, there are known issues in 4.5

    Does it crash if you are not using Citrix or RDC?


    Add comment
    10|10000 characters needed characters exceeded

    • It's not easy to switch to SP 22 or .NET 4.6, as another company manages the server. Besides, we do not experience this issue at servers of other customers, nor at a file server of this same company. So only on this Citrix terminal server.

      We investigated some more in this issue, and found something interesting. I made two console projects, one in VB.NET, one in C#. Both .NET 4.5.2. Both "Any CPU" as platform target, and both prefer 32-bit. Bot reference the same DLL, only CrystalDecisions.CrystalReports.Engine. The VB.NET version hangs on rd.Close(), the C# version doesn't.

      VB.NET code:

      Imports CrystalDecisions.CrystalReports.Engine

      Module Module1
      Sub Main(sArgs() As String)
      Dim rd As New ReportDocument rd.Load(sArgs(0))
      End Sub
      End Module

      C# code:

      using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
      using CrystalDecisions.CrystalReports.Engine;
      namespace cscon
      class Program
      static void Main(string[] args)
      ReportDocument rd = new ReportDocument();

      So basically exactly the same code...