This article describes the ParameterizedReport of ReportingServices ). According to the variability of report content, reports are classified into static reports and parameterized reports. data-driven parameterized reports are more in line with people's needs and habits. First, let's take a look at the steps to create a parameterized report using ReportingServices: 1. In the project AWRepor
This article describes the Parameterized Report of Reporting Services ). According to the variability of report content, reports are classified into static reports and parameterized reports. data-driven parameterized reports are more in line with people's needs and habits. First, let's take a look at the steps for using Reporting Services to create a parameterized report: 1. In the project AWRepor
This article describes the Parameterized Report of Reporting Services ).
According to the variability of report content, reports are classified into static reports and parameterized reports. data-driven parameterized reports are more in line with people's needs and habits.
First, let's take a look at how to create a parameterized report using Reporting Services:
1. Right-click the project AWReport and choose "add"> "new item"> "report" to add a new report rptPR. rdl;
2. In the report rptPR. on the "data" tab of rdl, click the dataset to go down to the list and create the dataset DataEmployee (1). Click "Universal Query designer" to switch to the query design status and add the table HumanResources. and select all columns as output.
Create a dataset
Parameter Name
Data Type
Prompt
PTitle
String
Title
PMStatus
String
Marital Status
PGender
String
Gender
PSFlag
Boolean
Paid?
PBDate
DateTime
Birthday
Table 1 parameter name, data type, and prompt settings
4. Switch to the "data" tab of the report and add the filter conditions shown in the corresponding fields.
Add parameters for fields as filter conditions
5. Switch to the "layout" tab of the report to display the layout shown in the report design.
Report Layout
6. In the preview status, specify different values for the parameters in the parameter items displayed in the report, and you can see the parameterized report shown in.
Parameterized reports in preview status
The actual values of "Marital Status" include M (Married, Married) and S (Single or Sole, unmarried). For users, it is obviously inappropriate to use a text box to accept the input value. For example, the full spelling of the input word or the first letter U of the Unmarried cannot be found, you can set the parameters in the "available values" Area of the "Report Parameters" dialog box, so that the "Marital Status" parameter can be entered using the drop-down list. The "gender" parameter should be set similarly.
Set available values for "Marital Status"
If you are unfamiliar with the title of a company employee or have different names for the title, the above problems will also arise, and the value of the "title" field is not fixed, system Maintenance may increase or decrease. In this case, you can specify the "available value" for this parameter in the query ". Note that if the Title field in the same dataset DataEmployee is used as the source of available values and the Title field is the first parameter, a forward dependency error occurs, the value of the Title field is determined by the following parameters. If the Title field is used as the last parameter, every time you change the value of other parameters, the data in the Title parameter drop-down list will be refreshed and changed (this can be used as a linkage between the province, city, and county ). In this case, you should consider creating another data set DataTitle using the method shown in, and specifying its data source:
SELECT Distinct Title FROM HumanResources. Employee
Then, specify the available value of the "title" parameter according to the settings shown in.
Set available value for "title"
In addition, you can specify the "Default Value" for each parameter to reduce the data input for common queries.
The report is displayed in 7 of a Web project.
Parameterized reports displayed in the Web Project (click the thumbnail to view the large image)
To a certain extent, Reporting Services meets users' requirements for parameterized reports, but there are also some improvements. For example, once a parameter is defined, the value of the parameter cannot be ignored to view the report.