本文介绍了CrystalReport 加载报告失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我有一个使用 Crystal Report 2008 的 Windows 应用程序项目(C# 和 .NET 2.0).但在加载报告时有时会出错(似乎是意外).那个错误是:

I have a windows application project (C# and .NET 2.0) that used Crystal Report 2008. But I get error sometimes (it seems accidentally) in loading report. That error is:

CrystalDecisions.Shared.CrystalReportsException: Load report failed.
System.Runtime.InteropServices.COMException (0x8000020D): Unable to load report.
   at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
   --- End of inner exception stack trace ---
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
at SIA.DataTransfer.Forms.frmReport.GetStateReport(Int32 transferType)

请指导我.我该如何解决这个问题?

please guide me. How can I solve this problem?

推荐答案

如果您的应用程序是独立的可执行文件,则会生成此错误,因为您在完成任何操作后都没有正确关闭报表对象.您可能会看到此错误在您的应用程序中作为 ASP.NET 应用程序运行,并且有很多用户同时访问您的站点.

If your application is a standalone executable then this error is generated because you are not closing your report object properly when you are done with whatever you do. You might see this error running in your application as an ASP.NET app with a lot of users accessing your site simultaneously.

您可以通过调整此注册表项来使错误更快出现:

You can cause the error to appear sooner by tweaking this registry key:

HKEY_LOCAL_MACHINESOFTWARECRYSTAL DECISIONS10.0REPORT APPLICATION SERVERSERVERPrintJobLimit

通常默认为 75.为了调试,您可以将其设置为较小的值,使错误更快出现.

It normally is defaulted to 75. For debugging you can set it to a smaller value and cause the error to appear sooner.

使用完报表对象后,调用 .Close() 方法,该方法将清理使用的非托管资源.

When you are done using a report object, call the .Close() method which will clean up the un-managed resources used.

有些人提到将设置更改为 -1.这是一个错误,它只会导致长时间运行的应用程序出现其他问题.该过程最终将耗尽资源并开始以更难以排除故障的方式失败.

There are those that mention to change the setting to -1. This is a mistake, it will only cause other problems for an application that is long running. The process will eventually run out of resources and start to fail in ways that will be even more difficult to troubleshoot.

这篇关于CrystalReport 加载报告失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 23:02