This is my declaration in the .cshtml file:
@(Html.TelerikReporting().ReportViewer()
.Id("reportViewer1")
.ServiceUrl(Url.Content("~/api/reports"))
.ReportSource(new TypeReportSource() { TypeName = "ReportLibrary." + Model.FormReportsModel.ReportID.ToString() + ", ReportLibrary" })
.ViewMode(ViewMode.Interactive)
.ScaleMode(ScaleMode.Specific)
.Scale(1.0)
.PersistSession(false)
.PrintMode(PrintMode.AutoSelect)
.EnableAccessibility(true)
.ClientEvents(events => events.RenderingBegin("onRenderingBegin"))
.ClientEvents(events => events.RenderingEnd("onRenderingEnd"))
.ParameterEditors(
editors => editors
.CustomEditors(new CustomParameterEditor
{
MatchFunction = "customMatch",
CreateEditorFunction = "createCustomEditor"
})
)
)
It's been running fine for years without the "ParameterEditors" bit. I added that not because I want to really edit a parameter, only because I realized I could change the initial hint:
function customMatch(p1) {
if (p1.name === "AccountID") p1.Error = "Please choose one";
if (p1.name === "FiscalManyYears") p1.Error = "Please choose at least two";
return false;
}
function createCustomEditor(placeholder, options) {
// This is not needed, because the previous function never returns TRUE.
}which works great on the new report . . . but suddenly all of the other reports are failing, because the [Preview] button never enables, no matter what selections are clicked for the parameters. If I remove the ".ParameterEditors()" clause, the [Preview] button reverts to behaving as expected.
I would be happy if someone could point out a mistake I'm making.