fix: use case-insensitive _Parameters lookup in RdlViewer (issue #274)#280
Merged
Conversation
- Change _Parameters from IDictionary to Dictionary<string,string> with StringComparer.OrdinalIgnoreCase so callers don't need to match RDL parameter name casing exactly - Fix GetParameters() to honor _Parameters values first for each UserReportParameter, falling back to GetValueAsync() only when absent; use case-insensitive runtimeParams dictionary to prevent duplicate keys - Fix ParametersBuild() to display programmatically-set _Parameters values in the UI panel controls instead of always showing RDL defaults - Fix ParametersLeave/ParametersTextValidated to sync UI-entered values back to _Parameters so they survive subsequent Rebuild() calls - Fix SetParameterValue() to initialize _Parameters when null Co-authored-by: Peter Gill <majorsilence@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes a regression in RdlViewer parameter handling (issue #274) by making programmatic parameter storage and lookup case-insensitive again and ensuring programmatic values are reflected in both report execution and the parameter UI.
Changes:
- Switch
_Parametersstorage toDictionary<string, string>(StringComparer.OrdinalIgnoreCase)where instantiated. - Update
GetParameters()to prefer programmatic_Parametersvalues (case-insensitive) perUserReportParameter, with fallback toGetValueAsync(), and merge extra entries. - Update parameter UI building and validation handlers to display/sync programmatic values via
_Parameters.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
681
to
685
| public void SetReportParametersAmpersandSeparated(string parameterString) | ||
| { | ||
| _Parameters = new Dictionary<string, string>(); | ||
| _Parameters = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); | ||
| if (String.IsNullOrEmpty(parameterString)) | ||
| return; |
Comment on lines
+1509
to
+1513
| // Honor programmatically-set parameters over runtime/default values. | ||
| // Case-insensitive lookup so callers don't need to match RDL casing exactly. | ||
| if (_Parameters != null && _Parameters.ContainsKey(urp.Name)) | ||
| runtimeParams[urp.Name] = _Parameters[urp.Name]; | ||
| else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #274
Addresses Copilot feedback about case-sensitive
_Parameterslookups and restores programmatic parameter loading broken in 5.0.19._Parametersis nowDictionary<string,string>(StringComparer.OrdinalIgnoreCase)everywhere it is createdGetParameters()honours_Parametersfirst for each UserReportParameter (case-insensitive), falling back toGetValueAsync()ParametersBuild()displays programmatic values in the UI panelParametersLeave/ParametersTextValidatedsync UI edits back to_ParametersGenerated with Claude Code