Error loading the report viewer's templates.

11 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
    422 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
    422 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!!
  7. Juan
    Juan avatar
    3 posts
    Member since:
    Jun 2020

    Posted 08 Jun in reply to Silviya Link to this post

    i tried this but still get the same error. please helme

     

    Error loading the report viewer's templates. (templateUrl = 'http://localhost:3200/api/reports/resources/templates/telerikReportViewerTemplate-14.1.20.513.html/').

  8. kzimny
    kzimny avatar
    11 posts
    Member since:
    Jul 2007

    Posted 12 Jun Link to this post

    Hi, .net core 3.1 and the same problem at my side.

    Error loading the report viewer's templates. (trvTemplateUrl = 'http://localhost:64900/api/reports/resources/templates/telerikReportViewerTemplate-14.1.20.603.html/').

  9. Juan
    Juan avatar
    3 posts
    Member since:
    Jun 2020

    Posted 12 Jun in reply to kzimny Link to this post

     

    HI.

     

    already solved!
    I had to add a template.html in my project in the assests folder and that's it.
    you can take the template from the resources installed in the telerik reporting

    C:\Program Files (x86)\Progress\Telerik Reporting R2 2020\Html5\ReportViewer\templates

    this saved my life!

    https://github.com/telerik/reporting-docs/blob/master/knowledge-base/how-to-load-telerik-report-viewer-resources-locally-in-angular-application-and-use-them-to-customize-the-viewer.md

     

     

  10. Bob
    Bob avatar
    25 posts
    Member since:
    Apr 2019

    Posted 16 Jun in reply to Juan Link to this post

    I have an o-pen support ticket on this.

    It get replied to every 24 hours and in the meantime my production site is down.

    No changes to npm/yarn package version in angular and no changes to nuget packages in dotnet core.

    Is the idea to ignore all posts until we all choose a different reporting engine which works?

     

Back to Top