Next topic is about how to get parameter data list from database query. User will be able to choose an item of list that retrieved from database. Still using this report, will create list for year (tahun) and city (kota).
Each parameter would need a dataset for retrieving data. To add a dataset view Data tab on the rdl file, drop down list combo of Dataset an choose< new dataset... >
Query for Year/Tahun:
SELECT DISTINCT '%' AS YearID, 'All' AS YearDisplay
UNION ALL
SELECT DISTINCT [Year] AS YearID, [Year] AS YearDisplay FROM Student
Set a name for dataset. Just like when we made data source for the report table. We also can choose command type. Text for SELECT query or using Stored Procedure. Finally click OK.
Also set for city/kota parameter, using this query:
SELECT DISTINCT '%' AS CityID, 'All' AS CityDisplay
UNION ALL
SELECT DISTINCT City AS CityID, City AS CityDisplay FROM Student
We'll have 2 new dataset in Data source list: Year and City.
To view content of dataset, choose dataset to view then click run icon/exclamation mark (!)
Next, we'll set parameter list. Go to menu, Report -> Report Parameter.
Setting parameter "Available Values" as image below.
Click tab Preview to see the result.
Click here if you like this article.
Related Article:
- Installing Business Intelligence SQL Server 2005
- Creating Report with SQL Server Reporting (Wizard)
- Creating Report with SQL Server Reporting (without wizard) | Part 1
- Creating Report with SQL Server Reporting (without wizard) | Part 2
- Design Layout Report
- Creating Parameter for Filtering
- Stored Procedure as Report Data Source
- Parameter Data List from Database Query
- Creating Report Group
- Create Sequence Number Using RowNumber Function
- Uploading Report FIle (.rdl) to Report Server
- Remove Report Page Break/Page Break
- Query to Generate Subscription List
- Direct Printing to Printer
0 Comments