I have a REST services console application which seems to be running successfully, in that I followed the instructions here:
and I'm able to serve up the document formats when I use IE to browse to:
http://localhost:8080/api/reports/formats
I have a Windows Form client in which I want to use an HTML5 report viewer, hosted in a System.Windows.Forms.WebBrowser.
I used the Telerik wizard to add an HTML5 Report Viewer, which I assume added all the necessary references, and created a sample report, and the necessary report viewer in a new html file. I am setting the url of the WebBrowser to the file location of my new report viewer html file, but I keep getting the following when I load the page:
Error loading the report viewer's templates.
I edited the default javascript to use the following:
<
script
type
=
"text/javascript"
>
$(document).ready(function () {
$("#reportViewer1")
.telerik_ReportViewer({
serviceUrl: "http://localhost:8080/api/reports",
templateUrl: "file://C:\Temp\Code\Reports\bin\Debug\ReportViewer\templates\telerikReportViewerTemplate-9.0.15.324.html",
reportSource: {
report: "file://C:\Temp\Code\Reports\bin\Debug\Reports\SampleReport.trdx",
parameters: {
Date: new Date(),
}
},
viewMode: telerikReportViewer.ViewModes.INTERACTIVE,
scaleMode: telerikReportViewer.ScaleModes.SPECIFIC,
scale: 1.0,
ready: function () {
//this.refreshReport();
},
});
});
</
script
>
Those two files exist at runtime (the template and the trdx file).
This is just proof-of-concept right now, so obviously the moving pieces are not all set. My thought is that the wizard is designed to set up a Web solution, not a Windows Forms solution, so I'm not set up correctly.
So can anyone suggest anything that might be causing that error?
Thanks,
Eric.