Crystal Report"文件名无效".问题

Moi*_*oiz 4 c# visual-studio-2008 crystal-reports-2008

我上传了我的WebApplication.我的应用程序是在带有Crystal Reports 2008 sp3的VS2008中.我上传了并行plex服务器.我在Bin文件夹中添加了所有必需的Crystal报表.我的报告路径也是正确的.

我收到的错误是

Line 41:         ReportDocument myreport = new ReportDocument();
Line 42:         string reportPath = Server.MapPath("~/CrystalReport.rpt");
Line 43:         myreport.Load(reportPath);
Line 44: 
Line 45:         myreport.SetDataSource(ds);


[COMException (0x800001fb): Invalid file name.]
   CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +95
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +356

[CrystalReportsException: Load report failed.]
   CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +418
   CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +895
   CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +84
   _Default.CreateReport() in d:\inetpub\vhosts\mydomain.in\subdomains\mysubdomain\httpdocs\Default.aspx.cs:43
   _Default.Page_Load(Object sender, EventArgs e) in d:\inetpub\vhosts\mydomain.in\subdomains\mysubdomain\httpdocs\Default.aspx.cs:21
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
Run Code Online (Sandbox Code Playgroud)

我无法得到错误的位置..报告位于根文件夹本身.那么这个问题是什么呢?还有一个文件夹aspnet_client.那是我们需要做的吗?

请等待回复

Ruc*_*han 15

同样的问题让我头疼了很长一段时间.现在我找到了答案:)

转到c:\windows\temp 文件夹及其properties->security 添加新用户" IIS_IUSRS"并赋予其完整/读写能力.

它解决了我的问题.

希望它也适合你:)