A little tip for people using Sql Server Reporting Services.

Y'know how you can define parameters that have "available values"? You can specify either a literal list of values, or a query from which the values are read. For the query option, you have to specify a "value field" and "label field", in case you want the user to be prompted with something that's meaningful to them. For example, you might want to show the user "ProductName" but use "ProductID" as the value of the parameter.

Now, if you want to display the value of a parameter (called, say, "Product") on a report, you use a TextBox whose value equates to "Parameters!Product.Value". But in the above example, that's only going to display the ProductID, not the meaningful name that the user selected.

So what do you do if you want to display the name of the product, rather than the value of the parameter?

Up until today I've been declaring a query, along the lines of, "SELECT ProductName FROM Products WHERE ProductID = @Product" - which would return the name of the product the user selected. But today I discovered a much better way:

Turns out that the "Parameter" object in Reporting Services has a "Label" property! The expression builder doesn't show it, but it's there! You can add a TextBox to your report which equates to, "Parameters!Product.Label" and it will show the meaningful value that the user selected!

This saves an extra trip to the server, which adds up for oft-used reports. I hope this message serves as some Google-juice for other users with this problem.