When I Am running The Application It Shows Error - Error loading the report viewer's templates

15 posts, 0 answers
  1. Chaitanya
    Chaitanya avatar
    16 posts
    Member since:
    Mar 2016

    Posted 23 Nov 2016 Link to this post

    When I Am trying to load the report viewer then it shows the below error .. i am unable to understand 'api/reports/' and 'telerikReportViewerTemplate-html'  where they are located  in my application.

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

  2. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 24 Nov 2016 Link to this post

    Hello chaitanya,

    Please check the details for the error in HTML5 Viewer Troubleshooting.

    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. ubaid
    ubaid avatar
    5 posts
    Member since:
    May 2018

    Posted 19 Sep 2018 Link to this post

    Hello Stef

    I followed all steps mentioned in HTML5 trouble shooting but still getting the same error

    even http://localhost:2923/api/reports/formats is working fine for me.

    I have created a new test project and it works there.

    I have compared the files and codes. Both are same but still getting this error

     

    Can you please guide?

     

     

     

     

     

  4. Silviya
    Admin
    Silviya avatar
    414 posts

    Posted 20 Sep 2018 Link to this post

    Hello ubaid,

    If the REST Service is working as expected, we assume that the report viewer client cannot access the service due to CORS limitations. When such issue is present you will see a CORS related error message in the browser's developer tools console (F12). When hosting the service in a separate application you will need to enable CORS as explained in this external resource.

    In case the issue still persist, open new support ticket and send us the problematic project for local investigation.

    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
  5. ubaid
    ubaid avatar
    5 posts
    Member since:
    May 2018

    Posted 25 Sep 2018 in reply to Silviya Link to this post

    Hi Silviya 

    I am getting this following error.

    GET http://localhost:2923/api/reports/resources/templates/telerikreportviewertemplate-html 404 (Not Found)

    It simply says it is not finding what I am trying to access.

    Whereas

    http://localhost:2923/api/reports/formats is working fine for me.

     

     

  6. ubaid
    ubaid avatar
    5 posts
    Member since:
    May 2018

    Posted 25 Sep 2018 Link to this post

    Hi Silviya,

     

    I am able to resolve this. 

    I was missing with styles, templates and fonts folder under ReportViewer

    I added these files to my project. Customized the paths and everything worked for me.

     

    Thanks for the support

     

  7. ubaid
    ubaid avatar
    5 posts
    Member since:
    May 2018

    Posted 25 Sep 2018 Link to this post

    Hi Silviya,

    I resolved the issues.

    Templates, styles and fonts were missing from my project

  8. Laz
    Laz avatar
    9 posts
    Member since:
    Jul 2013

    Posted 07 Nov 2018 Link to this post

    Hi

    I have an angular app which works fine using the telerik internet demo. when I use a rest service of one the samples I get

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

    I have enabled cors.

    The browser tells me it is a cors issue which is mis-leading as the network tab shows clearly 

    "Access-Control-Allow-Origin: *"

    Please help and also I need to know which rest services of the samples are appropriate for angular app as it is not included in the samples and left me guessing. Thanks very much

     

     

     

     

  9. ubaid
    ubaid avatar
    5 posts
    Member since:
    May 2018

    Posted 07 Nov 2018 in reply to Laz Link to this post

    Please make sure you have relevant templates under following folder

    ..\ReportViewer\templates\telerikReportViewerTemplate.html

     

    Hope that helps

  10. Laz
    Laz avatar
    9 posts
    Member since:
    Jul 2013

    Posted 13 Nov 2018 Link to this post

    Hi

    Can someone help me  which telerik rest service I need to use with angular report viewer, it has not been included with the samples. thanks in advance

    Laz

  11. Ronald
    Ronald avatar
    3 posts
    Member since:
    Jan 2016

    Posted 17 Dec 2018 Link to this post

    I'm posting this so someone searching for a solution can find it.

    I had the same issue and adding this

    Telerik.Reporting.Services.WebApi.ReportsControllerConfiguration.RegisterRoutes(config);

    To the webapiconfig.cs in the app_start folder solved it.

  12. Silviya
    Admin
    Silviya avatar
    414 posts

    Posted 17 Dec 2018 Link to this post

    Hello Ronald,

    Thanks for sharing this.

    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
  13. Erik
    Erik avatar
    2 posts
    Member since:
    Jun 2018

    Posted 29 Sep Link to this post

    I have the same problem, and have followed all instructions wrt setting up CORS.

    Can you pls elaborate on what is needed w.r.t. templates, fonts, etc?

    I'm not sure where these files should be located and where to add them from...

    Thx

  14. Mirzodaler
    Mirzodaler avatar
    8 posts
    Member since:
    Jun 2014

    Posted 01 Oct in reply to Ronald Link to this post

    Hi, How can we register routes configuration if we are using Telerik.Reporting.Services.AspNetCore?
  15. Peter
    Admin
    Peter avatar
    1665 posts

    Posted 02 Oct Link to this post

    Hello Mirzodaler,

    ASP.NET Core 2.1 and 2.2 do not needed to register the routes in the Startup, the ReportsController implementation Route attribute is sufficient. For more information see Manual Setup of HTML5 Report Viewer in an ASP.NET Core 2.1+ application: Setting up the REST service

    About ASP.NET Core 3.0 the routing should be enabled with the IApplicationBuilder.UseRouting() as shown in the following code snippet:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using Microsoft.AspNetCore.Builder;
    using Microsoft.AspNetCore.Hosting;
    using Microsoft.AspNetCore.HttpsPolicy;
    using Microsoft.AspNetCore.Server.Kestrel.Core;
    using Microsoft.Extensions.Configuration;
    using Microsoft.Extensions.DependencyInjection;
    using Microsoft.Extensions.Hosting;
    
    namespace CSharp.AspNetCore3Demo
    {
        public class Startup
        {
            private IServiceCollection services;
    
            public Startup(IConfiguration configuration)
            {
                Configuration = configuration;
            }
    
            public IConfiguration Configuration { get; }
    
            // This method gets called by the runtime. Use this method to add services to the container.
            public void ConfigureServices(IServiceCollection services)
            {
                this.services = services;
    
                services.Configure<IISServerOptions>(options =>
                {
                    options.AllowSynchronousIO = true;
                });
    
                services.AddSingleton<ConfigurationService>();
    
                services.AddRazorPages()
                    .AddNewtonsoftJson();
            }
    
                // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
            public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
            {
                this.services.AddTransient(ctx => new Controllers.ReportsController(new ConfigurationService(env)));
    
                if (env.IsDevelopment())
                {
                    app.UseDeveloperExceptionPage();
                }
                else
                {
                    app.UseExceptionHandler("/Error");
                    // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                    app.UseHsts();
                }
    
                app.UseHttpsRedirection();
                app.UseDefaultFiles();
                app.UseStaticFiles();
    
                app.UseRouting();
    
                app.UseEndpoints(endpoints =>
                {
                    endpoints.MapControllers();
                });
            }
        }
    
        public class ConfigurationService
        {
            public IConfiguration Configuration { get; private set; }
    
            public IWebHostEnvironment Environment { get; private set; }
            public ConfigurationService(IWebHostEnvironment environment)
            {
                this.Environment = environment;
    
                var config = new ConfigurationBuilder()
                                .SetBasePath(environment.ContentRootPath)
                                .AddJsonFile("appsettings.json", true)
                                .Build();
    
                this.Configuration = config;
            }
        }
    }

    Additionally we provide working demos with the Progress Telerik Reporting installation.

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