Expressions with Parameters


Up to this point, we have only talked about parameters within queries or queries being used as a source for data in parameters. Because the parameter collection is part of the Globals collection, you can use a parameter anywhere in the report.

For example, suppose you have a parameter called Emphasis . Its values come from a predefined list of controls within the report. The intention is to change the font style from normal to bold if the value of the parameter is set to the name of the control.

The following expression on the bold property of a fictitious Location control does exactly that:

 =IIF(Parameters!Emaphasis.Value="Location", True, False) 

Taking this a step further, you can change the visible property or any of the other properties in any report item. This allows you to use parameters in all sorts of ways not necessarily related to the data retrieved for a report.



Microsoft SQL Server 2005 Reporting Services
Microsoft SQL Server 2005 Reporting Services
ISBN: 0672327996
EAN: 2147483647
Year: 2004
Pages: 254

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net