Geting a Report view template (cross origin resource)

2 posts, 0 answers
  1. Andraz
    Andraz avatar
    1 posts
    Member since:
    Jan 2015

    Posted 28 Sep Link to this post

    Hi,

    I am working in .NET (MVC5). 

    My problem is with cross-origin resource sharing. When I am trying to get telerikReportViewerTemplate-html in Chrome (IE and Edge are working OK) I am getting this error: 

    "XMLHttpRequest cannot load http://localhost:56878/api/reports/resources/templates/telerikReportViewerTemplate-html. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:58343' is therefore not allowed access."

    This is my code in JS calling report viewer:

                $('#reportViewer').telerik_ReportViewer({
                    "serviceUrl": "http://localhost:56878/api/reports/",
                    "scale": 1.0,
                    "persistSession": false,
                    "parametersAreaVisible": true,
                    "documentMapVisible": true,
                    "viewMode": "INTERACTIVE",
                    "scaleMode": "SPECIFIC",
                    "printMode": "AUTO_SELECT",
                    "renderingBegin": "",
                    "renderingEnd": "",
                    "printBegin": "",
                    "printEnd": "",
                    "exportBegin": "",
                    "exportEnd": "",
                    "updateUi": "",
                    "error": "",
                    "pageReady": "",
                    "ready": "",
                    "parameterEditors": []
                });

     

    How can I put a permissions in request header?

     

  2. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 28 Sep Link to this post

    Hello Andraz,

    The Reporting REST service is WebAPi based controller. You can enable CORS for it and if you need to provide authorized access to resources returned by the service, you can override the ReportsControllerBase methods.


    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. DevCraft banner
Back to Top