2013-04-14 69 views
0

我得到錯誤不支持的操作。當嘗試以編程方式顯示在Crystal Reports環境中開發的Crystal報表時,由JRC引擎處理的文檔無法在C++堆棧中打開。錯誤在開發機器上打開水晶報告

我正在使用MS Visual Studio 2012,並試圖發佈我用於調用下面的這個報告以及堆棧跟蹤的完整代碼。這個問題發生在我的VS開發環境中。在發佈應用程序後發生這種情況時,我已經看到了幾篇文章和解決方案。我對水晶報表很新,而且我無法找到一種方法來完成這項工作。發生在負載點。

感謝所有幫助

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作爲新ReportClass() 第7行:rptH.FileName =使用Server.Mappath( 「〜/內容/ Reprots /報價/ EmployeeQuoteLandscape.rpt」) 第8行:rptH.Load() 第9行:rptH.SetDataSource( 「」)10 行:Dim流作爲IO.Stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)

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

堆棧跟蹤:

[COMException(0x80041811):Unsupported Operation。由JRC引擎處理的文檔不能在C++堆被打開。] CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(對象& DocumentPath,的Int32選項)0 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(對象& DocumentPath,的Int32選項)+138 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()+546

[CrystalReportsException:加載報告沒有] CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()647 CrystalDecisions.CrystalReports.Engine.ReportDocument.Load (字符串文件名,OpenReportMethod openMethod,Int16 parentJob)+1799 CrystalDecisions.CrystalReports.Engine.ReportClass.Load(字符串所以reportName,OpenReportMethod openMethod,Int16的parentJob)在d 278 CrystalDecisions.CrystalReports.Engine.ReportClass.Load()38 gbip_new.CrystalReportsController.EmployeeQuoteLanscape():\ Visual Studio中Projects \ GBIP \ gbip_new \ gbip_new \ Controllers \ CrystalReportsController.vb:8 lambda_method(Closure,ControllerBase,Object [])+102 System.Web.Mvc.ActionMethodDispatcher。執行(ControllerBase控制器,對象[]參數)59 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext,IDictionary的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.AsyncResultWrapper.End(IAsyncResult的asyncResult,對象標籤) +102 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)+50 System.Web.Mvc.Async。<> c _DisplayClass2a.b_ 20()+68 System.Web.Mvc.Async。 <>Ç _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,對象(IAsyncResult asyncResult,Object tag)+40 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)+44 System.Web.Mvc.Async。 <>Ç _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,對象標籤) 59 System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult的asyncResult,對象標籤)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步驟,布爾& completedSynchronously)155

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

回答

0

單詞「Reports」拼寫錯誤在您的文件路徑中。也許這就是問題所在?