开发者

App hosting Report Viewer crashes on exit after export

开发者 https://www.devze.com 2022-12-27 20:50 出处:网络
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

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 cyc开发者_C百科le 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消