0

我收到错误不支持的操作。尝试以编程方式显示在 Crystal Reports 环境中开发的 Crystal Report 时,无法在 C++ 堆栈中打开由 JRC 引擎处理的文档。

我正在使用 MS Visual Studio 2012 并尝试发布我用于在下面调用此报告的整个代码以及堆栈跟踪。问题出现在我的 VS 开发环境中。当它在发布应用程序后发生时,我已经看到了几个帖子和解决方案。我对 Crystal Reports 很陌生,我无法找到一种方法来完成这项工作。发生在负载点。

谢谢你的帮助

rpt properties
Build Action: Content
Cope to Output Directory: Do not copy
Custom Tool: blank
Custom Tool Name: blank



Imports CrystalDecisions.CrystalReports.Engine
Public Class CrystalReportsController
    Inherits System.Web.Mvc.Controller

    Public Function EmployeeQuoteLanscape() As ActionResult
        Dim rptH As New ReportClass()
        rptH.FileName = Server.MapPath("~/Content/Reprots/Quote/EmployeeQuoteLandscape.rpt")
        rptH.Load()
        rptH.SetDataSource("")
        Dim stream As IO.Stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)
        Return File(stream, "application/pdf")
    End Function
End Class

“/”应用程序中的服务器错误。

不支持的操作。JRC 引擎处理的文档无法在 C++ 堆栈中打开。

说明:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。

异常详细信息:System.Runtime.InteropServices.COMException:不支持的操作。JRC 引擎处理的文档无法在 C++ 堆栈中打开。

源错误:

第 6 行:Dim rptH As New ReportClass() 第 7 行:rptH.FileName = Server.MapPath("~/Content/Reprots/Quote/EmployeeQuoteLandscape.rpt") 第 8 行:rptH.Load() 第 9 行:rptH.SetDataSource( "") 第 10 行:昏暗流 As IO.Stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)

源文件:D:\Visual Studio Projects\GBIP\gbip_new\gbip_new\Controllers\CrystalReportsController.vb 行:8

堆栈跟踪:

[COMException (0x80041811):不支持的操作。JRC 引擎处理的文档无法在 C++ 堆栈中打开。] CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +138 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +546

[CrystalReportsException: 加载报告失败。] CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +647 CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +1799 CrystalDecisions.CrystalReports.Engine.ReportClass.Load( String reportName, OpenReportMethod openMethod, Int16 parentJob) +278 CrystalDecisions.CrystalReports.Engine.ReportClass.Load() +38 gbip_new.CrystalReportsController.EmployeeQuoteLanscape() 在 D:\Visual Studio Projects\GBIP\gbip_new\gbip_new\Controllers\CrystalReportsController.vb :8 lambda_method(闭包,ControllerBase,Object[])+102 System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase 控制器,Object[] 参数)+59 System.Web.Mvc.ReflectedActionDescriptor。执行(ControllerContext 控制器上下文,IDictionary2 parameters) +435 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2个参数) +60 System.Web.Mvc.Async.AsyncControllerActionInvoker.InvokeSynchronousActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary 2 parameters) +50 System.Web.Mvc.Async.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() +75 System.Web.Mvc.Async.<>c__DisplayClass81.b__7(IAsyncResult ) +44 System.Web.Mvc.Async.WrappedAsyncResult 1.End() +139 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +102 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +49 System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +126 System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +323 System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +44 System.Web.Mvc.Async.WrappedAsyncResult1.End() +139 System. Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +102 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +50 System.Web.Mvc.Async.<>c _DisplayClass2a.b_ 20 () +68 System.Web.Mvc.Async.<>c _DisplayClass25.b_ 22(IAsyncResult asyncResult) +184 System.Web.Mvc.Async.WrappedAsyncResult1.End() +136 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +56 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +40 System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +40 System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +47 System.Web.Mvc.Async.WrappedAsyncResult1.End() +151 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40 System.Web .Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +44 System.Web.Mvc.Async.<>c _DisplayClass4.b__3(IAsyncResult ar) +47 System.Web.Mvc.Async.WrappedAsyncResult1.End() +151 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +39 System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +39 System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +45 System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +47 System.Web.Mvc.Async.WrappedAsyncResult1.End() +151 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +59 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40 System.Web .Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +40 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult 结果) +38 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9629296 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

版本信息:Microsoft .NET Framework 版本:4.0.30319;ASP.NET 版本:4.0.30319.18034

4

1 回答 1

0

“报告”一词在您的文件路径中拼写错误。也许这就是问题所在?

于 2013-05-13T20:14:16.870 回答