Cross Origin

5 posts, 0 answers
  1. Nick
    Nick avatar
    6 posts
    Member since:
    Feb 2015

    Posted 10 Feb 2017 Link to this post

    We have reports deployed to a report server and they've been working great. All of the sudden, they are now throwing an error: Error loading the report viewer's templates. (Template = http://server/api/reports/resources/templates/telerikReportViewerTemplate-html). In dev tools it has: XMLHttpRequest cannot load http://server/api/reports/resources/templates/telerikReportViewerTemplate-html. The 'Access-Control-Allow-Origin' header has a value 'http://localhost:10969' that is not equal to the supplied origin. Origin 'http://someOtherServer' is therefore not allowed access.

    We call the reports from two different domains (azurewebsites and then a custom subdomain). How can we accomplish this?

    Thanks,

    Nick

  2. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 13 Feb 2017 Link to this post

    Hello Nick,

    The Reporting REST WebAPI based Service is a controller for which you can enable CORS. The linked article is an external tutorial describing the required Nuget packages, and the settings for the Reporting REST service's project.


    If you use Telerik Report Server, it is configured for CORS. The viewer calling the Report Server should be of the same version as the Report Server e.g., Report Server 2.2.16.1025 corresponds to v10.2.16.1025 of Telerik Reporting and its resources like HTML5 Viewer. Report Server R1 2017 is expected in March.


    I hope this helps.

    Regards,
    Stef
    Telerik by Progress
    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
  3. Thawdar
    Thawdar avatar
    2 posts
    Member since:
    Jul 2016

    Posted 02 Jan in reply to Stef Link to this post

    Hello Stef, 

    To enable CORS, we need to make reference Microsoft.AspNet.WebApi.Cors assembly files. But dependencies versions are >5.0.0. Your Telerik.Reporting.Services.WebApi assemblies are compatible with Microsoft.AspNet.WebApi.WebHost.4.0.30506. That's why we can't access-control-allow-origin. That is the main problem. 

  4. Thawdar
    Thawdar avatar
    2 posts
    Member since:
    Jul 2016

    Posted 02 Jan in reply to Nick Link to this post

    Hi Nick,

    I also facing the sample problem like you. Are you OK with your problem?

     

    Regards,

    Thawdar

  5. Katia
    Admin
    Katia avatar
    693 posts

    Posted 04 Jan Link to this post

    Hello Thawdar,

    Reporting REST service is built against WebAPI 1. If you use a newer version of Microsoft.AspNet.WebApi.WebHost add a binding redirect for the System.Web.Http and System.Net.Http.Formatting to their newer version in the application configuration file.


    Regards,
    Katia
    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