I have a Report Viewer Control in my Web page which is responsible to show all the reports.
I want to get the parameters of the report and check if the parameter has allow null property true then I want to pass the parameter value to null.
For this I have tried below code but I am getting AllowBlank property as false for all the parameters:
ReportParameterInfoCollection defaultParams;
List<ReportParameter> reportParams = new List<ReportParameter>();
defaultParams = ReportViewer1.ServerReport.GetParameters();
if (defaultParams.Count > 0)
{
foreach (ReportParameterInfo rp in defaultParams)
{
if (rp.AllowBlank)
{
string str = null;
reportParams.Add(new ReportParameter(rp.Name, str));
}
}
}