This is a migrated thread and some comments may be shown as answers.

How to use HTML5 Report Viewer in ASP.net Web Forms application (not MVC) ??? Please help

1 Answer 256 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
vlad
Top achievements
Rank 1
vlad asked on 17 Oct 2013, 08:03 PM
Hello everybody,

I am losing my hair on this one. Notice, I have never used routing or MVC before, so I am probably missing something obvious. I have a classic Web Forms project and need to integrate the new HTML5 Report Viewer.

Actually, when I start the HTML5 report viewer, I get the message inside the viewer "Error registering the viewer with the service". The html page is configured as suggested in Telerik's documentation, I have created a controller named "ReportsController" (as in doc).

To make run this controller, I have added the following in the Global.asax :

protected void Application_Start(object sender, EventArgs e)
{
      WebApplication1.App_Start.WebApiConfiguration.RegisterRoutes(GlobalConfiguration.Configuration);
}

and I have created a class named "WebApiConfiguration.cs" as follows:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
 
namespace WebApplication1.App_Start
{
    public static class WebApiConfiguration
    {
        public static void RegisterRoutes(HttpConfiguration httpConfiguration)
        {
            httpConfiguration.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = System.Web.Http.RouteParameter.Optional }
                );
 
            Telerik.Reporting.Services.WebApi.ReportsControllerConfiguration.RegisterRoutes(httpConfiguration);
        }
    }
}

Notice, I made no changes inside the webconfig.file

If I type http://localhost:65483/api/reports in the browser, I actually get some xml code :

[{"name":"PDF","localizedName":"Acrobat (PDF) file"},{"name":"CSV","localizedName":"CSV (comma delimited)"},{"name":"XLS","localizedName":"Excel 97-2003"},{"name":"XLSX","localizedName":"Excel Worksheet"},{"name":"PPTX","localizedName":"PowerPoint Presentation"},{"name":"RTF","localizedName":"Rich Text Format"},{"name":"IMAGE","localizedName":"TIFF file"},{"name":"MHTML","localizedName":"Web Archive"},{"name":"DOCX","localizedName":"Word Document"},{"name":"XPS","localizedName":"XPS Document"}]

But the HTML5 report viewer always tells : "Error registering the viewer with the service".

Really don't know what to do about this. As I said, I have no experience in routing / MVC.
Thanks a lot for your help and time,
Vlad


1 Answer, 1 is accepted

Sort by
0
Milen
Telerik team
answered on 21 Oct 2013, 04:20 PM
Hello Vlad,

Please refer to the help article How to: Host the REST Service in IIS. I believe that you are missing the necessary  ISAPI handlers in order to be able to handle POST requests. If you follow the steps as described the NuGet package will change the Web.config file as necessary.

Write us if you have additional questions.

Regards,

Milen
Telerik

Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

Tags
General Discussions
Asked by
vlad
Top achievements
Rank 1
Answers by
Milen
Telerik team
Share this question
or