I'm getting having a few issues with the MVC reporting implementation. I followed every step in this link here: http://www.telerik.com/help/reporting/mvc-report-viewer-extension-embedding.html, but I can't even display the product catalog report from adventure works. Initially, i was getting a JSON.Parse error in this function: On line 4, line 743 in the telerikReportViewer-8.1.14.804.js file included in my project.
After I stepped through the javascript, I found that the STATUS being passed into the function was a "parser error" and the ERROR was "unable to get report parameters". Initially, I was using the adventure works database and product catalog report, but I just decided to design my own from my own database. I used the report wizard inside Visual Studio 2012 and the preview worked great. However, as soon as I added it to the report viewer on my page, I get stuck here again.... Not sure what to do, because none of my reports take parameters. The report viewer shows up on my page no problem, but nothing is displayed.
My Razor page I'm displaying the report viewer on.
You can tell I tried just messing with adding paramters, but no luck.
01.
function
formatXhrError(xhr, status, error) {
02.
var
err;
03.
if
(xhr) {
04.
var
msg = JSON.parse(xhr.reponseText);
05.
if
(msg) {
06.
err = msg.message;
07.
if
(msg.exceptionMessage) {
08.
if
(err) {
09.
err +=
"<br/>"
;
10.
}
11.
err += msg.exceptionMessage;
12.
}
13.
}
14.
}
15.
if
(error) {
16.
err = error +
":<br/>"
+ err;
17.
}
18.
return
err || error;
19.
}
After I stepped through the javascript, I found that the STATUS being passed into the function was a "parser error" and the ERROR was "unable to get report parameters". Initially, I was using the adventure works database and product catalog report, but I just decided to design my own from my own database. I used the report wizard inside Visual Studio 2012 and the preview worked great. However, as soon as I added it to the report viewer on my page, I get stuck here again.... Not sure what to do, because none of my reports take parameters. The report viewer shows up on my page no problem, but nothing is displayed.
My Razor page I'm displaying the report viewer on.
01.
<div
class
=
"row fluid spacer"
style=
"margin-bottom:0px"
>
02.
<div
class
=
"md-col-12"
>
03.
@{
04.
var dataSource =
new
UriReportSource() { Uri =
"recipients.cs"
};
05.
//dataSource.Parameters.Add(new Telerik.Reporting.Parameter() { Name = "CheckNumber", Value = "2315527" });
06.
07.
}
08.
@(Html.TelerikReporting().ReportViewer()
09.
.Id(
"reportViewer1"
)
10.
.ServiceUrl(
"/api/reports/"
)
11.
.TemplateUrl(
"/ReportViewer/templates/telerikReportViewerTemplate-8.1.14.804.html"
)
12.
.ReportSource(dataSource)
13.
.ViewMode(ViewModes.Read)
14.
.ScaleMode(ScaleModes.SPECIFIC)
15.
.Scale(1.0)
16.
.PersistSession(
false
)
17.
)
18.
</div>
19.
</div>
You can tell I tried just messing with adding paramters, but no luck.