Skip to content

Commit

Permalink
Fixed an issue with Cascading parameter matching and the parameter va…
Browse files Browse the repository at this point in the history
…lue not existing yet to match on.
  • Loading branch information
alanjuden committed Jun 12, 2017
1 parent 08af23a commit fa24c95
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
19 changes: 11 additions & 8 deletions AlanJuden.MvcReportViewer.NetCore/ReportServiceHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,20 @@ public static ReportService.ReportParameter[] GetReportParameters(ReportViewerMo
var tempParameters = new List<ReportService.ParameterValue>();
foreach (var parameter in parameters)
{
var providedParameter = model.Parameters[parameter.Name];
if (providedParameter != null)
if (model.Parameters.ContainsKey(parameter.Name))
{
foreach (var value in providedParameter.Where(x => !String.IsNullOrEmpty(x)))
var providedParameter = model.Parameters[parameter.Name];
if (providedParameter != null)
{
tempParameters.Add(new ReportService.ParameterValue()
foreach (var value in providedParameter.Where(x => !String.IsNullOrEmpty(x)))
{
Label = parameter.Name,
Name = parameter.Name,
Value = value
});
tempParameters.Add(new ReportService.ParameterValue()
{
Label = parameter.Name,
Name = parameter.Name,
Value = value
});
}
}
}
}
Expand Down
19 changes: 11 additions & 8 deletions AlanJuden.MvcReportViewer/ReportServiceHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,20 @@ public static ReportService.ReportParameter[] GetReportParameters(ReportViewerMo
var tempParameters = new List<ReportService.ParameterValue>();
foreach (var parameter in parameters)
{
var providedParameter = model.Parameters[parameter.Name];
if (providedParameter != null)
if (model.Parameters.ContainsKey(parameter.Name))
{
foreach (var value in providedParameter.Where(x => !String.IsNullOrEmpty(x)))
var providedParameter = model.Parameters[parameter.Name];
if (providedParameter != null)
{
tempParameters.Add(new ReportService.ParameterValue()
foreach (var value in providedParameter.Where(x => !String.IsNullOrEmpty(x)))
{
Label = parameter.Name,
Name = parameter.Name,
Value = value
});
tempParameters.Add(new ReportService.ParameterValue()
{
Label = parameter.Name,
Name = parameter.Name,
Value = value
});
}
}
}
}
Expand Down

0 comments on commit fa24c95

Please sign in to comment.