Skip to Content
0

Application crashes on ReportDocument.Close()

Apr 13 at 01:11 PM

36

avatar image

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 ...
rd.Close()<br>

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) 13.0.21.2533. 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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Don Williams
Apr 24 at 05:42 PM
0

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.

Don

Share
10 |10000 characters needed characters left characters exceeded
Don Williams
Apr 18 at 01:55 PM
0

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.

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

Try 4.6 framework, there are known issues in 4.5

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

Don

Show 1 Share
10 |10000 characters needed characters left 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))
rd.Close()
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();
rd.Load(args[0]);
rd.Close();
}
}
}

So basically exactly the same code...

0