2017-10-20 308 views
2

我正尝试在Crystal报告中输入与其编辑掩码不匹配的参数值。它会引发报告应用程序服务器失败错误。无论如何要捕捉这个异常并抛出一个用户可理解的异常。问题是,堆栈跟踪不显示我的code.By过程中的任何部分我的代码是写在.NET报告应用程序服务器失败

 
System.Runtime.InteropServices.COMException: The Report Application Server failed 
     at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.GetParamPromptingInfo(PromptingRequestInfo promptingRequestInfo, Object& promptingUnits, Object& promptingInfoProvider) : Line 0 
     at CrystalDecisions.ReportSource.EromReportSourceBase.DoParameterPrompting(PromptingRequestContext reqContext) : Line 0 
     at CrystalDecisions.Web.ReportAgent+ReportClosedExceptionHandlingReportSource.DoParameterPrompting(PromptingRequestContext reqContext) : Line 0 
     at CrystalDecisions.Web.ReportAgentBase.DoPrompting(PromptingHTMLRenderOption htmlOption) : Line 0 
     at CrystalDecisions.Web.Components.ParamComponent.ShowFullPrompt() : Line 0 
     at CrystalDecisions.Web.Components.ParamComponentBase.HandleException(Exception e) : Line 0 
     at CrystalDecisions.Web.CrystalReportViewer.HandleExceptionAndPromptIfNeeded(Exception x, EnumAspNetLifeCycleStage stage) : Line 0 
     at CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e) : Line 0 
     at System.Web.UI.Control.PreRenderRecursiveInternal() : Line 0 
     at System.Web.UI.Control.PreRenderRecursiveInternal() : Line 0 
     at System.Web.UI.Control.PreRenderRecursiveInternal() : Line 0 
     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) : Line 0 
+0

您可以尝试按Ctrl + Alt + E打开“例外”窗口,然后选中“公共语言运行时例外”复选框。这将有希望缩小_where_这个异常正在抛出你的代码。 – gunr2171

+0

您如何在视图中显示报告? – gunr2171

回答

0

Asp.net的ReportViewer具有ReportError事件其中U可以处理和自定义错误OnReportError="ReportViewer1_OnReportError"

检查的CrystalReportViewer是否有类似的东西:

CrystalReportViewer.onHandleException or 
CrystalReportViewer.OnHandleExceptionAndPromptIfNeeded 

HandleException() Fired when an exception occurs. 

裁判:http://www.crystalreportsbook.com/Crystal_Reports_Net_Ch14_3.asp 不容易找到一个新的文档。

相关问题