Databases Reference
In-Depth Information
You can also change the FontSize and FontWeight properties if you prefer to dress things up a bit
more. I've also added a line to the report.
Now, click the Preview tab and notice what happens. The ReportTitle and TextColor parameters are
displayed in the header of the preview window with the default values, and these values are displayed
in the report.
Try changing the ReportTitle and Color using the parameter fields in the header, and click the View
Report button to refresh the report preview. The first text box should display the text entered into the
ReportTitle parameter, and the second text box should not only display the specific color name but
the text should also be displayed in that color, as in Figure 5-14.
Figure 5-14
As you can see, this is an effective way to feed values to the report to be used in expressions. We will
expand this technique to provide filtering and dynamic formatting.
Basing a Parameter on a Query
Whether report parameters are derived from query parameters or created within the report explicitly,
they may be used for a variety of things in the report. Often, it will make sense to let your user select
from a list of items to supply a parameter value. Parameter items may be populated from a static list or
from a data-driven query.
Parameter values can be selected from a data source through a data set that is set up within the report
designer like any data set you would use for the report itself. A report may contain any number of data
sets, some to supply parameter values and others to supply data for items within the report.
Using the sample Northwind database for a simple example, your report may be driven by a data set
that selects records from the Products table where the CategoryID matches a user-specified parameter
value. The CategoryID parameter values would be based on another data set that selects the CategoryID
and CategoryName columns from the Categories table. In Report Manager, the user simply selects a cat-
egory name from a drop-down list, and then the report is viewed showing only products that match the
selected category.
In the upcoming walk-through exercise, you will create different parameters that will not only drive the
report but will filter the values for multiple related parameters.
Search WWH ::




Custom Search