Passing a value to the parameter |
Top Previous Next |
Parameters are often used to ask a value from the user. Let us look at two ways to pass a value to the query parameter.
In the first way, you pass a value programmatically. Since there is no easy way to pass a value directly to the query parameter, you need to use the report parameter, which can be easily set via code. You should do the following:
[MyReportParameter]
report1.SetParameterValue("MyReportParameter", 10);
In the second way, you use the dialogue forms to do this (dialogue forms will be discussed later). For example, if you need to ask a string-type value, do the following:
Name=param1 DataType=VarChar DefaultValue= (empty string) Expression=TextBox1.Text Size=255
Where TextBox1 is a control which contains a value entered by the user.
|