Crystal report. "cannot find the specified path" in Windows Server 2008 using MVC

This works fine on the computer, but when I deployed it to the client’s test server. this error appears. the server is a standard version of Windows Server 2008. I am already checking the rpt path and installing CRV and allowing access to all. I spent almost 2 days and still can not find a solution.

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.<BeginInvokeSynchronousActionMethod>b__41() +28 System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>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.<BeginInvokeActionMethodWithFilters>b__33() +58 System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +225 System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>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.<BeginInvokeAction>b__20() +24 System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>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.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14 System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>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.<MakeVoidDelegate>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.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25 System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>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 
+5
source share
11 answers

I had problems deploying Crystal reports. The problem, as a rule, is that the correct version of Crystal Reports is running on the server, I mean 32 or 64 bits - depending on how the iis website is configured.

Another problem is that the user is working as in IIS - make sure that he has access to where the files are located.

+2
source

This may be a mistake.

In my case, the stored procedure for the report worked, as a rule, but when the parameter was passed in a specific format, it failed, which will throw an exception The system cannot find the file specified .

+1
source

I had the same problem, but when I saw that one report was working, I examined your properties and compared them with those that did not work. In fact, Crystal remains with the type of connection defined on the developer's machine, and if this connection is not established on the server, the application will fail. To fix this, you need to change the type of connection. In my case, I am replacing SQLNCLI11 with SQLOLEDB.

On VS2015, select a report, then go to Crystal Reports β†’ Database β†’ Set Database Location, then open Properties.

In the "Provider" property, change the connection type. I put SQLOLEDB and my report is excellent.

+1
source

Please check if you selected Copy to Output Folder as "Copy Always" in the properties of Crystal report files in visual studio.

Copy to output folder

Try it on another computer, and if it works, try reinstalling Crystal Report Report Viewer on Server 2008.

On a development system that you might run right this way, you will not encounter this error there, but you may encounter this error when deploying.

Here is one of the solutions for this exception.

0
source

I found out that Crystal Report does this if we upload data for it. But providing connection information makes it work.

 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); 
0
source

I had the same problem and the fix for me was to make sure you have one ODBC connection between the two machines. The file that he is looking for in this case seems to be an ODBC connection parameter. In addition, make sure that you have the same settings between your machines regarding bit rate. As with the case, the 32-bit ODBC settings and the 64-bit ODBC parameters should match the ones CR is looking for.

0
source

Make sure your Crystal report does not have a formula field or any other that refers to the database you are using is not connected. I have the same problem, I added some kind of crystal report to my Visual Studio project that was made by someone, I just modify SQL Query and make an ODBC connection to the database I want to connect, and I think that it should work fine. But I got an error message. "The system cannot find the path specified." After debugging the crystal in the reporting code, I found out again and again that the problem is in the "Formula" field. Finally, the problem is resolved. thanks Happy coding

0
source

We had a similar problem with compiling our application on different machines. This was due to incorrect subtitle paths. Make sure the subheading path is always accessible. This solved the problem on our side.

0
source

All ODBC connections must be the same, even if all connections point to the same connection. If you have a report with several signatures, and any of the data connections is called differently, you will get a "path not found" error.

0
source

The error message usually means nothing. One of the cases that I have met is that the request does not work properly in the oracle version installed in the environment. But it does work in the environment developed in the report. Another case that I met is that one of the supporting reports used different data types for comparison in oracle, and it seems that some instances support, while others will cause an error. And they both have the same non-informing error message.

0
source

I know this is an old thread, but I had the same error when deploying to Windows Server 2016. Locally it worked fine, but after deploying to the server, the error "Cannot find the specified path" occurred.

What I did to solve my problem: I went to IIS and created a virtual directory that pointed to the / AppName / bin / Reports folder where my report is located.

All is well!

0
source

Source: https://habr.com/ru/post/1210451/


All Articles