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

How does the report viewer locate the REST service?

1 Answer 83 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Al
Top achievements
Rank 1
Iron
Iron
Iron
Al asked on 06 Jun 2018, 06:37 AM

Hi,

I use the asp.net webforms viewer and set the report by setting

    reportViewer1.ReportSource.Identifier = reportFile;

I have a controller which uses a custom resolver

    public class ReportsController : ReportsControllerBase

 

Apparently this page uses the REST service to load the report but how does it know what url to use for the service? I haven't configured this explicitly as far as I can see so it seems to be hardcoded/defaulted?

1 Answer, 1 is accepted

Sort by
0
Accepted
Rick
Telerik team
answered on 06 Jun 2018, 05:47 PM
Hi Alwin,

The standard ReportsController REST service is setup using WebAPI 2.0 - which comes with certain assumptions baked into the framework. By default, services are available at SiteUrl/api/controllerName.

Telerik Reporting uses a REST service that is in a class called ReportsController (by default)

Finally, the HTML5ReportViewer has a ServiceUrl property that sets the location of the REST service. When the ServiceUrl is not set, the default is used, ServiceUrl="/api/reports"

Using all the defaults, the system works via the conventions of WebAPI.

Controller: ReportsController
ServiceUrl: /api/reports


Regards,
Rick
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Al
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Rick
Telerik team
Share this question
or