Declined
Last Updated: 31 Oct 2016 16:50 by Chavdar
Yan
Created on: 22 Jul 2014 09:52
Type: Feature Request
1
bug with subfolder project in ASP.NET MVC (HTML) ReportViewer
Hi, I found a bug, my MVC project is in a subfolder, and for this I have a problem with the ways I use "~" in order to specify the full path to take. 
and then I have a problem ReportViewer 

   @ (this.Html.TelerikReporting () 
           . ReportViewer () 
           . Id ("reportViewer1") 
           . ServiceUrl ("/api/reports/") 
           . TemplateUrl ("/templates/template.html") 
           . ReportSource (typeReportSource) 
            . ViewMode (ViewModes.PRINT_PREVIEW) 
           . ScaleMode (ScaleModes.SPECIFIC) 
           . Scale (1.0) 
           . PersistSession (false))

the fact that in this form 
            . ServiceUrl ("/ api / reports /") 
            . TemplateUrl ("/ themplate / themplate.html") 
operating normally. but it turns out that no subfolders. 
because it is taken still relative.
in when the site is in a sub - I get a 404 error. 
ie ReportViewer script takes a relative path. 
and this is a big problem :) 

Once again, my ASP.NET MVC site is in a subfolder of another ASP.NET project.

get something like: 
my site root url: mysite.com/project1 
and pages:
mysite.com/project1/myreportPage 
mysite.com/project1/api/reports 
1 comment
Chavdar
Posted on: 31 Oct 2016 16:42
You can try to specify the ServiceUrl and TemplateUrl in the following way:

.ServiceUrl(Url.Content("~/api/reports/"))
.TemplateUrl(Url.Content("~/ReportViewer/templates/telerikReportViewerTemplate.html")). 

Calling Url.Content method using "~" in the beginning should be able to resolve the paths correctly.