水晶报道。 使用MVC在Windows Server 2008中找不到“指定的路径”

这可以在计算机中正常工作,但是当我将其部署到客户端测试服务器时。 弹出此错误。 服务器是Windows Server 2008标准版。 我已经检查了rpt的路径并安装了CRV并允许所有人访问。 我花了差不多2天仍然找不到解决方案。

Server Error in '/QC' Application. The system cannot find the path specified. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: The system cannot find the path specified. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [COMException (0x80004005): The system cannot find the path specified. ] CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext) +0 CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) +1140 CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext) +656 CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportOptions options) +111 CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportFormatType formatType) +99 Sanipex.Infrastructure.Label.PrintToImage(String inputPath, String parameter, String outputPath, ImageFormat formatType) +482 Sanipex.Controllers.WarehouseController.ScanLabel(Nullable`1 qty, Nullable`1 missinglabel, String txtdate, String product, Nullable`1 linenumber, Nullable`1 ordernumber, String btnsubmit, SessionData model, Cases casemodel) +17807 lambda_method(Closure , ControllerBase , Object[] ) +465 System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +182 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27 System.Web.Mvc.Async.c__DisplayClass42.b__41() +28 System.Web.Mvc.Async.c__DisplayClass8`1.b__7(IAsyncResult _) +10 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32 System.Web.Mvc.Async.c__DisplayClass39.b__33() +58 System.Web.Mvc.Async.c__DisplayClass4f.b__49() +225 System.Web.Mvc.Async.c__DisplayClass37.b__36(IAsyncResult asyncResult) +10 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34 System.Web.Mvc.Async.c__DisplayClass2a.b__20() +24 System.Web.Mvc.Async.c__DisplayClass25.b__22(IAsyncResult asyncResult) +99 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27 System.Web.Mvc.c__DisplayClass1d.b__18(IAsyncResult asyncResult) +14 System.Web.Mvc.Async.c__DisplayClass4.b__3(IAsyncResult ar) +23 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +39 System.Web.Mvc.Async.c__DisplayClass4.b__3(IAsyncResult ar) +23 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +29 System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10 System.Web.Mvc.c__DisplayClass8.b__3(IAsyncResult asyncResult) +25 System.Web.Mvc.Async.c__DisplayClass4.b__3(IAsyncResult ar) +23 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +31 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9631916 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155 Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929 

我在部署水晶报告方面遇到了类似的问题。 问题通常是在服务器上安装正确的水晶报告运行时,正确的意思是32或64位 – 取决于iis网站的设置方式。

另一个问题是该站点在IIS中运行的用户 – 确保它可以访问文件所在的位置。

这可能是误导性错误。

在我的情况下,报告的存储过程一般都有效,但是当以某种格式传递参数时它会失败,这会导致The system cannot find the file specifiedexception。

我遇到了同样的问题,但是看到一份报告正在运行,我检查了你的财产并与那些不起作用的财产进行了比较。 事实上,Crystal保留了开发人员计算机上定义的连接类型,如果在服务器上没有安装该连接,则应用程序将失败。 要纠正这一点,必须改变连接类型。 在我的情况下,我用SQLOLEDB替换SQLNCLI11。

在VS2015上,选择您的报告,然后转到菜单“Crystal Reports”>>“数据库”>>“设置数据库位置”,然后展开“属性”。

在“Provider”属性上更改连接类型。 我把SQLOLEDB和我的报告完美地运用了。

请检查您是否在visual studio下的水晶报告文件的属性中选择了“ Copy to Output Folder作为"Copy Always"

复制到输出文件夹

在其他计算机上试用它,如果有效,则可以尝试在Server 2008计算机中重新安装Crystal Report Viewer。

在开发系统中,您可能已直接运行,在那里您将不会遇到此错误,但在部署时您可能会遇到这些错误。

这是给定exception的一种解决方案。

如果我们为他加载数据,就会发现Crystal Report会这样做。 但提供连接信息使其工作。

 var report = new ReportDocument(); report.Load("FILE PATH HERE"); report.SetParameterValue("@myParameter", "Value"); var connectionBuilder = new SqlConnectionStringBuilder(connectionString); foreach (var connection in report.DataSourceConnections) { if (connectionBuilder.IntegratedSecurity) { connection.SetConnection(connectionBuilder.DataSource, connectionBuilder.InitialCatalog, true); } else { connection.SetConnection(connectionBuilder.DataSource, connectionBuilder.InitialCatalog, connectionBuilder.UserID, connectionBuilder.Password); connection.IntegratedSecurity = false; } } return report.ExportToStream(ExportFormatType.PortableDocFormat); 

我有同样的问题,我的修复是确保你在两台机器之间有相同的ODBC连接。 在这种情况下它正在寻找的文件似乎是ODBC连接参数。 此外,请确保您的机器之间有关于位数的相同设置。 同样,32位ODBC设置与64位ODBC设置必须匹配CR正在寻找的一个。

确保Crystal报表没有任何公式字段或与未连接的数据库链接的任何其他字段。 我有一个相同的问题,我在我的Visual Studio项目中添加了一些由某人制作的水晶报表,我只是更改SQL查询并建立ODBC连接到我想要连接的数据库,我认为它应该可以正常工作。 但我得到错误信息。 “该系统找不到指定的路径。” 在一次又一次地调试到水晶报告代码后,我才知道问题在公式字段中。 最后问题解决了。 谢谢快乐编码

我们在不同的机器上编译应用程序时遇到了类似的问题。 这是由于子报告的路径不正确。 确保始终可以访问子报表的路径。 这解决了我们这方面的问题。

即使连接都指向同一连接,ODBC连接也需要命名相同。 如果您有一个包含多个子报表的报表,并且任何数据连接的命名方式不同,您将收到“找不到路径”错误。

错误消息通常没有任何意义。 我遇到的一个案例是查询在环境中安装的oracle版本中运行不正常。 但它确实在开发报告的环境中正常运行。 我遇到的另一个案例是其中一个子报告在oracle中使用了不同的数据类型进行比较,似乎有些实例支持而其他实例会抛出错误。 而且他们都只有相同的无信息错误信息。