简体   繁体   English

在开发机上打开水晶报告时出错

[英]error opening a crystal report on development machine

I get error Unsupported Operation. 我收到错误“不支持的操作”。 A document processed by the JRC engine cannot be opened in the C++ stack when trying to programmatically display a Crystal Report developed in the Crystal Reports environment. 尝试以编程方式显示在Crystal Reports环境中开发的Crystal Report时,无法在C ++堆栈中打开JRC引擎处理的文档。

I am using MS Visual Studio 2012 and trying to I have posted the entire code I am using for calling this report below, as well as the stack trace. 我正在使用MS Visual Studio 2012,并尝试在下面发布用于调用此报告的整个代码以及堆栈跟踪。 The problem is occuring in my VS development environment. 我的VS开发环境中出现了问题。 I have seen several posts and solutions for this when it occurs after publishing the application. 发布该应用程序后,我已经看到了一些相关的帖子和​​解决方案。 I am very new to Crystal Reports, and I am unable to find a way to make this work. 我对Crystal Reports非常陌生,无法找到一种方法来完成这项工作。 The is occurring at the load point. 发生在负载点。

Thanks for any help 谢谢你的帮助

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

Server Error in '/' Application. “ /”应用程序中的服务器错误。

Unsupported Operation. 不支持的操作。 A document processed by the JRC engine cannot be opened in the C++ stack. JRC引擎处理的文档无法在C ++堆栈中打开。

Description: An unhandled exception occurred during the execution of the current web request. 说明:执行当前Web请求期间发生未处理的异常。 Please review the stack trace for more information about the error and where it originated in the code. 请查看堆栈跟踪,以获取有关错误及其在代码中起源的更多信息。

Exception Details: System.Runtime.InteropServices.COMException: Unsupported Operation. 异常详细信息:System.Runtime.InteropServices.COM异常:不支持的操作。 A document processed by the JRC engine cannot be opened in the C++ stack. JRC引擎处理的文档无法在C ++堆栈中打开。

Source Error: 源错误:

Line 6: Dim rptH As New ReportClass() Line 7: rptH.FileName = Server.MapPath("~/Content/Reprots/Quote/EmployeeQuoteLandscape.rpt") Line 8: rptH.Load() Line 9: rptH.SetDataSource("") Line 10: Dim stream As IO.Stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat) 第6行:将rptH设置为新ReportClass()第7行:rptH.FileName = Server.MapPath(“〜/ Content / Reprots / Quote / EmployeeQuoteLandscape.rpt”)第8行:rptH.Load()第9行:rptH.SetDataSource( “”)第10行:Dim流为IO.Stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)

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

Stack Trace: 堆栈跟踪:

[COMException (0x80041811): Unsupported Operation. [COMException(0x80041811):不支持的操作。 A document processed by the JRC engine cannot be opened in the C++ stack.] CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +138 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +546 由JRC引擎处理的文档无法在C ++堆栈中打开。] CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object&DocumentPath,Int32选项)+0 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object&DocumentPath,Int32选项)+138 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()+546

[CrystalReportsException: Load report failed.] 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() in D:\\Visual Studio Projects\\GBIP\\gbip_new\\gbip_new\\Controllers\\CrystalReportsController.vb:8 lambda_method(Closure , ControllerBase , Object[] ) +102 System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +59 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary 2 parameters) +435 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary [CrystalReportsException:加载报告失败。] CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()+647 CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename,OpenReportMethod openMethod,Int16 parentJob)+1799 CrystalDecisions.CrystalReports.Engine.ReportClass.Load(字符串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。 :8 lambda_method(Closure,ControllerBase,Object [])+102 System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase控制器,Object []参数)+59 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext,IDictionary 2 parameters) +435 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary 2 parameters) +435 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary 2 parameters) +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__DisplayClass8 1.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.WrappedAsyncResult 1.End() +139 System.Web.Mvc.Async.AsyncResultW 2 parameters) +435 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary 2参数)+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__DisplayClass8 1.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.WrappedAsyncResult 1.End() +139 System.Web.Mvc.Async.AsyncResultW rapper.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.WrappedAsyncResult 1.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.WrappedAsyncResult 1.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) +4 rapper.End(IAsyncResult asyncResult,Object标记)+102 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)+50 System.Web.Mvc.Async。<> c _DisplayClass2a.b_ 20()+68系统。 Web.Mvc.Async。<> c _DisplayClass25.b_ 22(IAsyncResult asyncResult)+184 System.Web.Mvc.Async.WrappedAsyncResult 1.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.WrappedAsyncResult 1.End()+151 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult,Object tag)+59 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult,对象标记)+40 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)+4 4 System.Web.Mvc.Async.<>c _DisplayClass4.b__3(IAsyncResult ar) +47 System.Web.Mvc.Async.WrappedAsyncResult 1.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.WrappedAsyncResult 1.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.EndProc 4 System.Web.Mvc.Async。<> c _DisplayClass4.b__3(IAsyncResult ar)+47 System.Web.Mvc.Async.WrappedAsyncResult 1.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.WrappedAsyncResult 1.End()+151 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult,Object tag)+59 System.Web.Mvc .Async.AsyncResultWrapper.End(IAsyncResult asyncResult,Object标签)+40 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)+40 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProc essRequest(IAsyncResult result) +38 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9629296 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155 essRequest(IAsyncResult结果)+38 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+9629296 System.Web.HttpApplication.ExecuteStep(IExecutionStep步骤,布尔值且已完成)+155

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

The word "Reports" is misspelled in your filepath. 您的文件路径中的单词“ Reports”拼写错误。 Perhaps that's the problem? 也许那是问题所在?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM