CrystalReport on iis server does not work - ASP: NET MVC

2

Good friends, I inform you that I have a problem with Crystal Report on a server IIS .

Before publishing if it works for me, but when I mount it in the Servidor IIS it gives me this error

  

The system can not find the specified route. Description:   Unhandled exception when executing the current Web request. Check the   Track the stack for more information about the error and   where it originated in the code.

     

Exception details: System.Runtime.InteropServices.COMException:   The system can not find the specified route.

Source code error:

  

An unhandled exception was generated during the execution of the   Current Web request. Information on the origin and location of   The exception can be identified using the exception of   Track the next stack.

Tracking the stack:

[COMException (0x80004005): El sistema no puede encontrar la ruta especificada.
]
   CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext) +0
   CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) +1140
   CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext) +655
   CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportOptions options) +111
   CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportFormatType formatType) +98
   wSicavWeb.Controllers.Liquidacion.CotizacionController.ExportReport(Int32 id) in c:\Users\MichelRemoto\Desktop\Agencia 2017\wSicavWebMichel\wSicavWeb\Controllers\Liquidacion\CotizacionController.cs:52
   lambda_method(Closure , ControllerBase , Object[] ) +97
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary'2 parameters) +157
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary'2 parameters) +27
   System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__36(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +22
   System.Web.Mvc.Async.WrappedAsyncResult'2.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase'1.End() +49
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32
   System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3c() +50
   System.Web.Mvc.Async.<>c__DisplayClass45.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3e() +225
   System.Web.Mvc.Async.<>c__DisplayClass30.<BeginInvokeActionMethodWithFilters>b__2f(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResult'1.CallEndDelegate(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResultBase'1.End() +49
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34
   System.Web.Mvc.Async.<>c__DisplayClass28.<BeginInvokeAction>b__19() +26
   System.Web.Mvc.Async.<>c__DisplayClass1e.<BeginInvokeAction>b__1b(IAsyncResult asyncResult) +100
   System.Web.Mvc.Async.WrappedAsyncResult'1.CallEndDelegate(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResultBase'1.End() +49
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13
   System.Web.Mvc.Async.WrappedAsyncVoid'1.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase'1.End() +49
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +36
   System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12
   System.Web.Mvc.Async.WrappedAsyncVoid'1.CallEndDelegate(IAsyncResult asyncResult) +22
   System.Web.Mvc.Async.WrappedAsyncResultBase'1.End() +49
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__4(IAsyncResult asyncResult, ProcessRequestState innerState) +21
   System.Web.Mvc.Async.WrappedAsyncVoid'1.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase'1.End() +49
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9765121
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
  • Install the patches of SAP crystal.

  • Check the route and it's the same (even if I remove the address report it gives me the error that it is not).

  • The report makes the view if I go directly to it.

  • It works on the solution, but not on the IIS

asked by Michel Colmenares 31.03.2017 в 21:50
source

2 answers

1

I'll tell you how I do it.

1.- I create a variable with the path where the files are

  string DirectorioReportesRelativo = "~/Reportes/Apertura/";

2.- I create the route with the name of the file

 string urlArchivo = string.Format("{0}.{1}", "ValOfertasDetalle", "rpt");

            string FullPathReport = string.Format("{0}{1}",
                                    this.HttpContext.Server.MapPath(DirectorioReportesRelativo),
                                     urlArchivo);

            report.FileName = FullPathReport;

and at the end I'm uploading the file.

report.Load();
    
answered by 08.11.2018 в 16:14
0

In this method:

wSicavWeb.Controllers.Liquidation.CotizationController.ExportReport

Not that finding the physical route of the report!

Remember that in ASP.NET to obtain the physical path of where a file is located within the web app you must use HttpContext.Current.Server.MapPath

var rpt = new ReportDocument();    
//Localizar el path del reporte
rpt.Load(Server.MapPath("~/Reportes/DemoCrystalReport.rpt"));   

Could you put part of the code that you read the report to see how you get it? So we can help you better

    
answered by 01.04.2017 в 04:47