views:

93

answers:

1

We have a .NET Winforms application that hosts the Crystal Reports Viewer control (Version XI). It works well for the most part but when an export of data from the viewer is performed the application will crash on exit and in unmanaged code. The error message is not very useful and just says that an incorrect memory location was accessed. No other info such a specific DLL etc. is provided.

This only happens after the viewer is used to export a report to CSV, XML etc. My guess is that at some point in the export process Crystal creates a resource that attempts an action on shut down to a parent window (perhaps) that no longer exists.

I've seen a number of memory leak and shut down issues with Crystal but this one's new. Has anyone seen it and come up with a workaround or has ideas for workarounds?

So far we've tried explicitly disposing of all crystal-related objects, setting to null and even setting a Thread.Sleep cycle on shut down to "give Crystal time to clean up."

Update:

  • The crash happens only on shut down (so not immediate)
  • All export formats work
  • All export files are created properly
  • CR is installed on the same machine as the hosting .NET app
  • not sure about exporting from the IDE... is that even possible?
A: 

Check your code to ensure that you only open the Crystal Application object once during the lifecycle of your application. This will prevent excessive memory usage, usage that may be causing your crashes. Obviously, you can open and close reports at will.

Craig