Hello, I am trying to get my first report working with .NET MVC and the Reporting Q2 2014 HTML5 viewer. I was able to create a report viewer page in my application and view the sample reports, but have been unable to pass a report parameter to my custom report. I used the standalone designer to create the .trdx file, specified a parameter (ClientID) to be passed to the datasource, which is a SQL datasource that calls a stored procedure. That stored procedure has a single parameter, @clientID, which is mapped to the report ClientID parameter. The report parameter is an integer, and will eventually be set to visible = false when I get all of this sorted out.
Using the preview feature of the standalone designer, I got the same error that I see in my web application ('Missing or invalid parameter value. Please input valid data for all parameters.') until I made the parameter visible and entered a value. Once I did that, data was correctly returned. I am passing the report parameters like so:
When the page loads, a breakpoint on the reportSource lines shows that the parameter values are correctly set, and when the report viewer is displayed, the parameter value shows in the parameters pane on the right hand side, but clicking 'Preview' simply repeats the parameter missing message.
I'm not sure where I've gone wrong in the binding on the web side - some older posts mentioned a version of Newtonsoft.JSON being in the GAC might cause a problem - I have verified that's not the case here.
Any ideas where I've mis-stepped?
Thanks!
Using the preview feature of the standalone designer, I got the same error that I see in my web application ('Missing or invalid parameter value. Please input valid data for all parameters.') until I made the parameter visible and entered a value. Once I did that, data was correctly returned. I am passing the report parameters like so:
@{
var reportSource = new UriReportSource() {
Uri = Url.Content("EligibilitySummary.trdx")
};
reportSource.Parameters.Add(new Parameter("clientID", Clients.GetByAuthenticatedUser().ClientID));
@(Html.TelerikReporting().ReportViewer()
.Id("reportViewer1")
.ServiceUrl(Url.Content("/api/reports/"))
.TemplateUrl(Url.Content("/ReportViewer/templates/telerikReportViewerTemplate-8.1.14.618.html"))
.ReportSource(reportSource)
.ViewMode(ViewModes.INTERACTIVE)
.ScaleMode(ScaleModes.SPECIFIC)
.Scale(1.0)
.PersistSession(false));
}
When the page loads, a breakpoint on the reportSource lines shows that the parameter values are correctly set, and when the report viewer is displayed, the parameter value shows in the parameters pane on the right hand side, but clicking 'Preview' simply repeats the parameter missing message.
I'm not sure where I've gone wrong in the binding on the web side - some older posts mentioned a version of Newtonsoft.JSON being in the GAC might cause a problem - I have verified that's not the case here.
Any ideas where I've mis-stepped?
Thanks!