Error loading the report viewer's templates.

6 posts, 0 answers
  1. Tuan
    Tuan avatar
    8 posts
    Member since:
    Apr 2018

    Posted 27 Apr 2018 Link to this post

    I have Rest Service (ASP.Net Web Application-->Empty-->check MVC)

    Result: successed (pictrure: 1.jpg)

    I have project Angular and call Rest Service

    <tr-viewer [containerStyle]="viewerContainerStyle"
    [serviceUrl]="'http://localhost:56342/api/reports'"
    [viewMode]="'INTERACTIVE'"
    [scaleMode]="'SPECIFIC'"
    [scale]="1.0">
    </tr-viewer>

    Error (picture: 2.jpg)

    Error loading the report viewer's templates. 

     

  2. Silviya
    Admin
    Silviya avatar
    414 posts

    Posted 27 Apr 2018 Link to this post

    Hello Tuan,

    Based on the first attached image, it seems that the REST Service is working since you can successfully request the JSON with export formats.


    However, receiving the "No 'Access-Control-Allow-Origin' allowed access" error in the Browser console means that there is no Cross-Origin Resource Sharing (CORS) enabled. 
    Like in your scenario, the Angular viewer and the REST Service are in a separate projects and they are running on different hosts, so CORS should be enabled.
     
    I have attached a short video demonstrating how to enable CORS for the REST Service. The video is silent, in .swf format that could be played in a Browser with installed Flash plugin.

    Regards,
    Silviya
    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
  3. Tuan
    Tuan avatar
    8 posts
    Member since:
    Apr 2018

    Posted 29 Apr 2018 in reply to Silviya Link to this post

    Thank you very much.
  4. Raul
    Raul avatar
    11 posts
    Member since:
    Aug 2017

    Posted 25 Jul 2018 Link to this post

    I have the same problem, but whit Angular, somebody may help me please. the video from Silviya does´t work, only have a two images.
  5. Silviya
    Admin
    Silviya avatar
    414 posts

    Posted 26 Jul 2018 Link to this post

    Hi Raul,

    Please note that enabling CORS configuration have to be utilized in the REST Service project, not in Angular application. For more information, please refer to Enable CORS and Enabling Cross-Origin Requests in ASP.NET Web API 2.

    Regards,
    Silviya
    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
  6. Tom
    Tom avatar
    1 posts
    Member since:
    Mar 2016

    Posted 14 Aug 2018 in reply to Silviya Link to this post

    Silviya, you are a genius! I’m new to Telerik Reporting and have been stuck with a broken REST service for weeks. I stumbled upon this post and your video was PERFECT! I was running my Viewer client in a separate project from the REST server without CORS and my handlers were not right from having done NuGet updates. Problem solved and we’re finally now making progress with Progress! Thanks for being a great help!!
Back to Top