I'm working on a ASP.net application which allows users to select an SSRS report from a dropdown list, fill in report parameters and then view the report in ReportViewer on the next page. Some of the parameters have valid values, which I get from the RDLC file using code below:
private ValidValue[] GetParameterValidValues(string parameterName, string reportDirectory)
{
ServerReport serverReport = new ServerReport();
string reportServerUrl = Application["ReportServerUrl"] as string;
serverReport.ReportPath = reportDirectory + lbReports.SelectedItem.Value;
serverReport.ReportServerUrl = new Uri(reportServerUrl);
ReportParameterInfo reportParameter = serverReport.GetParameters()[parameterName];
ValidValue[] validValues = reportParameter.ValidValues.ToArray();
return validValues;
}
These values are then added to dynamically created dropdown lists on the page.
The problem is that in some cases parameter A can filter valid values of parameter B. This functionality can be observer when selecting parameters in the ReportViewer control.
My question is, how can I implement this functionality in my code?