[英]Crystal Reports mvc
我用 c# mvc 4.8 做了一個應用程序,我用水晶報告做的報告很少。
在調試的 Visual Studio 2019 上運行良好。 一旦我部署到本地 IIS 報告不起作用。
我有以下錯誤。 我可以在配置文件中添加一些東西嗎? 我已經安裝了運行時 sap 最新版本 64 位。
無法打印報告 CrystalDecisions.Shared.CrystalReportsException:加載報告失敗。 ---> System.Runtime.InteropServices.COMException:系統找不到指定的文件。 在 CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) 在 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) 在 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() --- 內部異常堆棧結束跟蹤 --- 在 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 ArsWeb .Controllers.ReportsController.ActivityLogReport(ActivityLog 模型)
有什么解決辦法嗎?
謝謝
通常,這個錯誤有2個原因,您可以嘗試以下方法來解決問題。
權限問題
應用程序必須有權訪問 Temp 文件夾。 你有兩個選擇來解決這個問題(選擇任何一個)。
1. 如何為Web服務器上的Windows臨時文件夾分配權限。
2. ASP.NET 冒充。
ASPNET 機器帳戶要添加到 Temp 目錄,因此我們必須在 Web.config 文件中為標記指定用戶名和密碼屬性,以識別 IIS Authenticated Account 或 User。
<identity impersonate="true" userName="accountname" password="password" />
文件路徑或文件名無效
1.確保報告文件名正確(可能是 Typo 之類的。例如:Repotr1.rpt 而不是 Report1.rpt)。
2.確保報告路徑正確(例如:“Reports/Report1.rpt”而不是“~/Reports/Report1.rpt”)。
3.實際上我們有些人忘記將報告文件復制到發布文件夾(IIS虛擬目錄)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.