Reporting Services¶
In this lab, we will work with Microsoft SQL Server Reporting Services, a tool we have not seen before. We will start working together, then some of the exercises will be individual work. You shall submit the solution to all exercises.
Pre-requisites and preparation¶
Required tools to complete the tasks:
- A PC with Windows.
- Microsoft SQL Server: The free Express version is sufficient, or you may also use localdb installed with Visual Studio
- SQL Server Management Studio
- Database initialization script: adventure-works-2014-oltp-script.zip
- Microsoft Visual Studio 2019 (2022 does not work here): The free Community edition is sufficient
- Report Server Project support for Visual Studio: Microsoft Reporting Services Projects extension (Keep the extension up to date.)
- GitHub account and a git client
Materials for preparing for this laboratory:
- Using Microsoft SQL Server: description and video
- SQL Reporting Services official tutorial
Initial steps¶
Keep in mind that you are expected to follow the submission process.
Create and check out your Git repository¶
-
Create your git repository using the invitation link in Moodle. Each lab has a different URL; make sure to use the right one!
-
Wait for the repository creation to complete, then check out the repository.
If you are not asked for credentials to log in to GitHub in university computer laboratories when checking out the repository, the operation may fail. This is likely due to the machine using someone else's GitHub credentials. Delete these credentials first (see here), then retry the checkout.
-
Create a new branch with the name
solution
and work on this branch. -
Open the checked-out folder and type your Neptun code into the
neptun.txt
file. There should be a single line with the 6 characters of your Neptun code and nothing else in this file.
Create the Adventure Works 2014 database¶
We will work with the Adventure Works sample database. This database contains the operational information of a fictional retail company. Instead of understanding the database contents, we will use a few predefined queries that list product purchases.
-
Download adventure-works-2014-oltp-script.zip and extract it to folder
C:\work\Adventure Works 2014 OLTP Script
(create the folder if it does not exist yet).The folder name should be as above; otherwise, you need to change the path in the sql script:
-- NOTE: Change this path if you copied the script source to another path :setvar SqlSamplesSourceDataPath "C:\work\Adventure Works 2014 OLTP Script\"
If you need to edit the path, make sure to keep the trailing slash!
-
Connect to Microsoft SQL Server using SQL Server Management Studio. Use the following connection details.
- Server name:
(localdb)\mssqllocaldb
when using LocalDB, orlocalhost\sqlexpress
when using SQL Express - Authentication:
Windows authentication
- Server name:
-
Use File / Open / File... to open
instawdb.sql
from the folder created above. Do not execute it yet! First, you should turn on SQLCMD mode: in the Query menu click SQLCMD Mode; then click Execute. -
Verify whether the database and its contents are created. Select Databases in the Object explorer on the left and click Refresh. The AdventureWorks2014 database shall appear with a number of tables inside.
.
-
Open a new SQL Query window on this database (right-click the database and choose New query), and execute the following script with your own Neptun code substituted:
update Production.Product set Name='NEPTUN'+Name
Check the contents of the table
Production.Product
and verify if it has your Neptun code in the product names: right-click the table and choose Select top 1000 rows.IMPORTANT
Your Neptun code must be listed in the names. You will need to create screenshots in the following exercises, and your Neptun code must appear on these images.