How does the report viewer locate the REST service?

2 posts, 1 answers
  1. Al
    Al avatar
    228 posts
    Member since:
    Oct 2006

    Posted 06 Jun 2018 Link to this post


    I use the 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?

  2. Answer
    Rick avatar
    14 posts

    Posted 06 Jun 2018 Link to this post

    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

    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
Back to Top