This is a migrated thread and some comments may be shown as answers.

MVC report client request doesn't works.

2 Answers 90 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Fernando
Top achievements
Rank 1
Fernando asked on 18 Jul 2014, 01:45 PM
I'm using the MVC report in a new MVC project and until now, everything worked as expected. When I tried to pass the code to the target project, the html report interface stopped to work. The problem is in its request to api client, that I realize it request about 5~7 per report.

In the first request it uses this url: http://localhost:2000/Basic/api/ReportBase/clients.

It works, but the second ones doesn't(404 error). It uses this url: http://localhost:2000/Basic/api/ReportBase/clients/100526-0a0c/parameters

I have not added any routes in order to the first request to work. I'm using just the MVC default route. In my test project, it works with the default route, as well. 
I want to know why the subsequent requests doens't works. I wonder if its a route problem or anything else.

Thank you.

2 Answers, 1 is accepted

Sort by
0
Fernando
Top achievements
Rank 1
answered on 18 Jul 2014, 01:58 PM
Here is the MVC helper call, if needed:

01.@(Html.TelerikReporting().ReportViewer()
02..Id("reportViewer1")
03..ServiceUrl("/Basic/api/ReportBase"
04..TemplateUrl("/Basic/content/reports/telerikReportViewerTemplate.html")
05..ReportSource(new UriReportSource() { Uri = String.Concat("{ controller: '", ViewBag.Controller, "' }") })
06..ViewMode(ViewModes.INTERACTIVE)
07..ScaleMode(ScaleModes.SPECIFIC)
08..Scale(1.0)
09..PersistSession(false)<br>)
0
Manuel
Top achievements
Rank 1
answered on 21 Jul 2014, 10:04 AM
You have to register the Telerik Web API routes. Usually this is done by calling the method 'ReportsControllerConfiguration.RegisterRoutes(config)' in the file App_Start\WebApiConfig.cs. But since you are using a custom service URL ("Basic" prefix), you'll have to register the routes manually as explained here: How to change the registered by default Telerik Reporting REST Web API routes
Tags
General Discussions
Asked by
Fernando
Top achievements
Rank 1
Answers by
Fernando
Top achievements
Rank 1
Manuel
Top achievements
Rank 1
Share this question
or