c# - Telerik HTML5 Report Viewer - Error loading the report viewer's templates -


i'm having issue trying use telerik rest services , html5 report viewer.

here's scenario:

i have c# console application hosting rest services api. have set project per telerik's article: how to: self host telerik reporting rest web api. seems working without issue. able go http://localhost:8080/api/reports/formats , expected results, suggests me rest server available , processing requetss.

i set separate project run report viewer. c# windows forms application, has webbrowser element pointing url of report viewer html file. report viewer html file default generated file when create new telerik html 5 report viewer in visual studio - builds of necessary pieces you. here code:

<!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head>     <title>telerik html5 report viewer</title>      <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />     <meta http-equiv="x-ua-compatible" content="ie=edge" />      <link href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet" />      <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>      <link href="http://cdn.kendostatic.com/2013.2.918/styles/kendo.common.min.css" rel="stylesheet" />     <link href="http://cdn.kendostatic.com/2013.2.918/styles/kendo.blueopal.min.css" rel="stylesheet" />      <!--kendo.all.min.js can used instead of kendo.web.min.js , kendo.mobile.min.js-->     <script src="http://cdn.kendostatic.com/2013.2.918/js/kendo.web.min.js"></script>     <!--kendo.mobile.min.js - optional, if gestures/touch support required-->     <script src="http://cdn.kendostatic.com/2013.2.918/js/kendo.mobile.min.js"></script>      <link href="reportviewer/styles/telerikreportviewer-9.0.15.324.css" rel="stylesheet" />     <script src="reportviewer/js/telerikreportviewer-9.0.15.324.min.js"></script>    <style>         #reportviewer1 {             position: absolute;             left: 5px;             right: 5px;             top: 5px;             bottom: 5px;             overflow: hidden;             font-family: verdana, arial;         }     </style> </head> <body>      <div id="reportviewer1">      </div>         <script type="text/javascript">             $(document).ready(function () {                $("#reportviewer1")                    .telerik_reportviewer({                           serviceurl: "http://localhost:8080/api/reports/",                         templateurl: "reportviewer/templates/telerikreportviewertemplate-9.0.15.324.html",                        //reportsource - report description                        reportsource: {                            report: "reports/samplereport.trdx",                                                      parameters: {                                date: new date(),                            }                        },                         viewmode: telerikreportviewer.viewmodes.interactive,                                         scalemode: telerikreportviewer.scalemodes.specific,                        scale: 1.0,                         ready: function () {                            //this.refreshreport();                        },                    });            });     </script>  </body> </html> 

when run appliaction, web browser loads page, displays " error loading report viewer's templates." i've tried putting templates on server side of things, can't seem figure out i'm doing wrong.

if has suggestions try resolve error, appreciate it! using telerik 2015 q1.

thanks!

i have found problem. turns out cross-origin problem. ended taking required templates , scripts , such, , hosting them on simple iis page on server, , reference them using absolute url. has gotten me around issue having.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -