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

ASP.Net viewer and HTML5 viewer…what's the difference?

6 Answers 158 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
أشرف
Top achievements
Rank 1
أشرف asked on 14 Aug 2014, 11:21 AM
Greetings,

The company I'm working for decided to evaluate Telerik's reporting tools.
I visited the reporting portal to view some demos. I noticed that there're two different offerings: The HTML5 viewer and the ASP.Net viewer.

I assume that the ASP.Net viewer is just a .Net wrapper around the JS/HTML/CSS workings of the plain HTML5 viewer, but I noticed that the two viewers differ in appearance and in some behaviours (the preloader that appears when the report is being fetched for example).

Can anyone provide me with guidance about the architecture and composition of the two viewers to be able to evaluate when to use which?

6 Answers, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 18 Aug 2014, 11:54 AM
Hi Ashraf,

The ASP.NET Report Viewer is the first web viewer for Telerik Reporting that depends on HTTP Handler and uses the ASP.NET controls for toolbar and parameter area. While the HTML5 Report Viewer is our latest report viewer that depends on Telerik Reporting REST Service and uses the Kendo UI widgets. 

We highly recommend the HTML5 Report Viewer because it's compatible with all modern and mobile browsers. Additionally the HTML5 Report Viewer is more customizable.

The only benefit from using the older ASP.NET Report Viewer is the support for older browsers IE6, 7, 8. The HTML5 report viewer requires HTML5 and only HTML5 compliant browser are supported. For example IE9+, Chrome and Firefox. For more information check out the Browser Support help article.

Regards,
Peter
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
أشرف
Top achievements
Rank 1
answered on 18 Aug 2014, 01:35 PM
Thank you for your reply.
But wouldn't the HTML5 viewer be hard to configure for ASP.Net server side developers?
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 18 Aug 2014, 01:57 PM
...its not hard to configure at all, and the end result is a lot nicer (and lighter) than the webforms viewer.  Just follow the docs.
0
أشرف
Top achievements
Rank 1
answered on 26 Aug 2014, 02:47 PM
I've setup the HTML5 viewer, and currently am able to display reports.

But I can't figure how to change a report's culture.

In one of your examples, I found this code:
01.$("#reportViewer1")
02.            .telerik_ReportViewer({
03.                serviceUrl: "/api/reports/",
04.                templateUrl: '/ReportViewer/templates/telerikReportViewerTemplate-x.x.x.x.htmll',
05.                reportSource: {
06.                    report: "Telerik.Reporting.Examples.CSharp.ProductCatalog, CSharp.ReportLibrary",
07.                    parameters: {
08.                        CultureID: "en"
09.                    }
10.                }
11.            });

There's this CultureID parameter, but the documentation doesn't say anything about it nor it's mentioned anywhere else.

I thought I should extract it in the controller, so, I wrote the following code:
01.public class ReportsController : ReportsControllerBase
02.    {
03.        private const string CultureIdParameterName = "cultureId";
04. 
05.        private static void SetCulture(ClientReportSource reportSource)
06.        {
07.            if(reportSource.ParameterValues.ContainsKey(CultureIdParameterName))
08.            {
09.                var thread = Thread.CurrentThread;
10.                var culture = new CultureInfo((string)reportSource.ParameterValues[CultureIdParameterName]);
11. 
12.                thread.CurrentUICulture = culture;
13.                thread.CurrentCulture = culture;
14.            }
15.        }
16. 
17.        public override HttpResponseMessage CreateInstance(string clientID, ClientReportSource reportSource)
18.        {
19.            SetCulture(reportSource);
20. 
21.            return base.CreateInstance(clientID, reportSource);
22.        }
23. 
24.        public override HttpResponseMessage GetParameters(string clientID, ClientReportSource reportSource)
25.        {
26.            SetCulture(reportSource);
27. 
28.            return base.GetParameters(clientID, reportSource);
29.        }
30.…

And on the client side:
01.document.getElementById("ddlLanguage").addEventListener("change", function (e)
02.            {
03.                var viewer = $("#rpt").data("telerik_ReportViewer");
04. 
05.                viewer.reportSource({
06.                    report: viewer.reportSource().report,
07.                    parameters: { cultureId: e.target.value }
08.                });
09. 
10.                viewer.refreshReport();
11.            });

But this doesn't work. The report viewer makes concurrent requests served by more than one thread, so, changing the thread culture doesn't change the language of the rendered report.

In the application I develop, reports language isn't tied to the language of the application. For example, the user may log into the system using the English UI but view reports in Arabic or vice versa, so I need a method by which the user can set the language of the reports. I don't want reports to be rendered in the default ASP.Net thread language.

I've already wrote my custom IReportResolver that's based on reports GUID's, and thought that I may add another piece of inforamtion to the GUID to indicate the reports language, but I think that this solution is ugly, as the ReportResolver shouldn't have anything to do with report language, and the language should only be specified as a parameter.
0
أشرف
Top achievements
Rank 1
answered on 27 Aug 2014, 04:28 PM
I resorted to using cookies to change the language. I don't like it because it's not aligned to the REST style, but it works anyway.

Sometimes when I refresh reports, I get this error message:
Error creating report document 'xxxxxxxx' Report Format HTML5Interactive Report instance with ID 'xxxxxxx' not found
What may be the cause of this?
0
Hinata
Top achievements
Rank 1
answered on 29 Aug 2014, 11:24 AM
Hi Ashraf,

The Product Catalog report gets its localized string from the AdventureWorks database by passing the CultureID parameter to the data source. You can check the source code in your Reporting installation folder.
If your method using cookies is causing the error message, you can localize the report strings by passing the same CultureID parameter to the report and using either the approach from the Product Catalog report, or use User Functions to return the localized strings.
Tags
General Discussions
Asked by
أشرف
Top achievements
Rank 1
Answers by
Peter
Telerik team
أشرف
Top achievements
Rank 1
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Hinata
Top achievements
Rank 1
Share this question
or