I am having a problem getting a report parameter to work in an MVC application. The goal is to have the report results filtered by student number. I have the parameter and filter configured in the report designer. I can apply the student number to the report when running the report in the designer so this problem is isolated to the MVC application specifically. Here is some of the key code that (I think) should be sufficient to understand what I am trying to do:
Inside HomeController:
public ActionResult StudentReport()
{
var uriReportSource = new UriReportSource();
uriReportSource.Uri = "Report1.trdp";
uriReportSource.Parameters.Add(new Parameter("StudentNumber", "120432"));
return View();
}
Inside StudentReport.cshtml:
<body>
@(Html.TelerikReporting().ReportViewer()
.Id("reportViewer1")
.ServiceUrl(Url.Content("~/api/reports"))
.ReportSource(new UriReportSource() { Uri = "Report1.trdp" })
.ViewMode(ViewMode.Interactive)
.ScaleMode(ScaleMode.Specific)
.Scale(1.0)
.PersistSession(false)
.PrintMode(PrintMode.AutoSelect)
.EnableAccessibility(false)
)
</body>
The error I am getting is: An error has occurred while processing Report 'Report1': Cannot perform '=' operation on System.Double and System.String.