Using Report (Reporting Services) parameter values in ASP.NET page

Posted by noup on Stack Overflow See other posts from Stack Overflow or by noup
Published on 2010-04-30T14:28:26Z Indexed on 2010/04/30 16:27 UTC
Read the original article Hit count: 251

I have a report (Reporting Services) integrated into an ASP.NET that shows dropdownlists to select report parameter values. The dropdownlists are populated using direct database selects, though I see the report RDL files do contain the paramter values and datasets as defined in the report designer.

Is it possible to obtain the report parameters "available values" in ASP.NET to populate the dropdownlists? This would avoid some code duplication.

Update

If the parameter doesn't use a query for available values, the following works:

foreach (ValidValue value in this.ReportViewerControl.ServerReport.GetParameters()["myParameter"].ValidValues) {
    this.DropDownListControl.Items.Add(new ListItem(value.Label, value.Value));
}

Still haven't found a way to access report datasets though...

© Stack Overflow or respective owner

Related posts about reporting-services

Related posts about ASP.NET