Skip to content

fix: use case-insensitive _Parameters lookup in RdlViewer (issue #274)#280

Merged
majorsilence merged 1 commit into
mainfrom
claude/issue-274-20260616-2217
Jun 16, 2026
Merged

fix: use case-insensitive _Parameters lookup in RdlViewer (issue #274)#280
majorsilence merged 1 commit into
mainfrom
claude/issue-274-20260616-2217

Conversation

@majorsilence

Copy link
Copy Markdown
Owner

Fixes #274

Addresses Copilot feedback about case-sensitive _Parameters lookups and restores programmatic parameter loading broken in 5.0.19.

  • _Parameters is now Dictionary<string,string>(StringComparer.OrdinalIgnoreCase) everywhere it is created
  • GetParameters() honours _Parameters first for each UserReportParameter (case-insensitive), falling back to GetValueAsync()
  • ParametersBuild() displays programmatic values in the UI panel
  • ParametersLeave / ParametersTextValidated sync UI edits back to _Parameters

Generated with Claude Code

- 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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 _Parameters storage to Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) where instantiated.
  • Update GetParameters() to prefer programmatic _Parameters values (case-insensitive) per UserReportParameter, with fallback to GetValueAsync(), 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 thread RdlViewer/RdlViewer.cs
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 thread RdlViewer/RdlViewer.cs
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
@majorsilence majorsilence merged commit 8c73cfa into main Jun 16, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RdlViewer version 5.0.19

2 participants