Hi @Matthew Rikard
According to the report viewer control's release notes, WebForms(150.1357.0) fixes issues with Null and datetime parameters.
For more details, you can refer to this link: release-notes-ssrs-application-integration.
Best regards,
Aniya
Microsoft.ReportViewer.WebForms nullable parameters checkbox doesn't clear parameter
With this latest release of Microsoft.ReportViewer.WebForms (150.1537.0), nullable parameters in the WebForms module have lost functionality. Prior to this release, if there were data in a nullable parameter and then the null checkbox was checked, the data in the parameter cleared out. Likewise when the checkbox was already checked and the user entered text into the parameter, the checkbox would uncheck itself.
This is no longer happening and is causing our users to run their reports in unexpected ways.
SQL Server Reporting Services
3 answers
Sort by: Most helpful
-
Anonymous
2022-12-06T05:45:42.89+00:00 -
Matthew Rikard 1 Reputation point
2022-12-07T14:56:21.61+00:00 Our DLL
And here is a gif showing the current behavior
Prior to this change, entering a value in a nullable field would uncheck the null checkbox
Likewise, checking the null checkbox would remove the value in the nullable field
This is causing our clients to be confused on what they are reporting. -
Matthew Rikard 1 Reputation point
2022-12-08T16:52:17.953+00:00 For anyone else coming across this question, it is not resolved as the notes above state "WebForms(150.1357.0) fixes issues with Null and datetime parameters." as I believe this is a separate issue.
We were able to implement a workaround hack by adding the following JavaScript on the page showing the report viewerfunction reportViewerNullBugWorkaround(id) { if (!/cbNull$/.test(id)) { return; } let cb = document.getElementById(id); let tb = document.getElementById(id.replace("cbNull", "txtValue")); if (!cb || !tb) { return; } tb.addEventListener("keyup", function() { if (tb.value) { cb.checked = ""; } else { cb.checked = "checked"; } }); cb.addEventListener("change", function() { if (cb.checked) { tb.value = ""; } }); } document.addEventListener("DOMContentLoaded",function(){ Array.from(document.querySelectorAll('input[type=checkbox]')).forEach((b) => { reportViewerNullBugWorkaround(b.id); }); });
However, we look forward to the proper solution when we will remove this workaround.