Unable to find part of the route + could not find a part of the path

0

People! through the following line

Me.ReportViewer1.LocalReport.ReportPath = "Presentacion\reportes\AtencionesXProfXFecha.rdlc"

I tell you report to open my Reportviewer, the problem is that on a local server if I walk while the other does not and I get the error

Could not find a part of the path 

Any recommendations on how to solve this? Thank you very much!!

    
asked by DavidC 08.08.2017 в 16:16
source

1 answer

0

Try with:

Me.ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/Presentacion/reportes/AtencionesXProfXFecha.rdlc")

This way you will avoid that sometimes, depending on the deployment environment, it will not be possible to solve the location of a resource.

Server.MapPath("~/")

Solve at the time of execution the root path of your website, from then on you can use a location relative to your root site.

    
answered by 08.08.2017 в 18:04