Introduction
This article is an introduction to creating an SSRS Report from Azure SQL. SQL Server Reporting Services (SSRS) is still a popular tool to generate reports. It is true that PowerBI is the most popular Microsoft reporting tool (yes, Excel is not a reporting tool, let's face it), but SSRS still has some customers and is also used for backward compatibility, licenses, etc. Some customers still want to use SSRS and I still receive requests to generate new reports or update existing ones.
In this article, I will create a report based on data stored in an Azure SQL table named customer. In this article, we will do the following:
- Firstly, I will configure Azure SQL and create a table with data.
- Also, we will install the SSRS projects in VS if they were not installed before.
- Next, we will create a report of the Azure SQL data.
- Finally, we will edit and modify the format and add some columns to the report.
Requirements
- First of all, you will need an Azure account.
- Secondly, install Visual Studio. In this example, I am using VS 2019.
Configure Azure SQL and Create a Table
- First, in the Azure Portal, create a resource.
- Secondly, go to SQL Database and select the create option
- Thirdly, select a subscription and a resource group create a new server if you do not have any, and enter a name for the database used.
- In addition, when the Azure SQL Server is created, you will have the server admin which is the login name. In Show firewall settings, you may need to add your IP to Configure the Azure Server
- Also, we will use the query editor in the Azure SQL Database to create a table. You will need to log in to the query editor.
- We will run a query to create a table named dbo.customer.
- The following table will be used.
The following table will be used.CREATE TABLE [dbo].[Customer]( [CustomerID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL, [NameStyle] int NOT NULL, [Title] [nvarchar](8) NULL, [FirstName] [nvarchar](40) NOT NULL, [MiddleName] [nvarchar](40) NULL, [LastName] [nvarchar](40) NOT NULL, [Suffix] [nvarchar](10) NULL, [CompanyName] [nvarchar](128) NULL, [SalesPerson] [nvarchar](256) NULL, [EmailAddress] [nvarchar](50) NULL, [Phone] [nvarchar](40) NULL, [PasswordHash] [varchar](128) NOT NULL, [PasswordSalt] [varchar](10) NOT NULL, [rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL, [ModifiedDate] [datetime] NOT NULL )
- Finally, we will insert some data in the customer table.
SET IDENTITY_INSERT [dbo].[Customer] ON INSERT [dbo].[Customer] ([CustomerID], [NameStyle], [Title], [FirstName], [MiddleName], [LastName], [Suffix], [CompanyName], [SalesPerson], [EmailAddress], [Phone], [PasswordHash], [PasswordSalt], [rowguid], [ModifiedDate]) VALUES (1, 0, N'Mr.', N'Orlando', N'N.', N'Gee', NULL, N'A Bike Store', N'adventure-works\pamela0', N'orlando0@adventure-works.com', N'245-555-0173', N'L/Rlwxzp4w7RWmEgXX+/A7cXaePEPcp+KwQhl2fJL7w=', N'1KjXYs4=', N'3f5ae95e-b87d-4aed-95b4-c3797afcb74f', CAST(N'2005-08-01T00:00:00.000' AS DateTime)) INSERT [dbo].[Customer] ([CustomerID], [NameStyle], [Title], [FirstName], [MiddleName], [LastName], [Suffix], [CompanyName], [SalesPerson], [EmailAddress], [Phone], [PasswordHash], [PasswordSalt], [rowguid], [ModifiedDate]) VALUES (2, 0, N'Mr.', N'Keith', NULL, N'Harris', NULL, N'Progressive Sports', N'adventure-works\david8', N'keith0@adventure-works.com', N'170-555-0127', N'YPdtRdvqeAhj6wyxEsFdshBDNXxkCXn+CRgbvJItknw=', N'fs1ZGhY=', N'e552f657-a9af-4a7d-a645-c429d6e02491', CAST(N'2006-08-01T00:00:00.000' AS DateTime)) INSERT [dbo].[Customer] ([CustomerID], [NameStyle], [Title], [FirstName], [MiddleName], [LastName], [Suffix], [CompanyName], [SalesPerson], [EmailAddress], [Phone], [PasswordHash], [PasswordSalt], [rowguid], [ModifiedDate]) VALUES (3, 0, N'Ms.', N'Donna', N'F.', N'Carreras', NULL, N'Advanced Bike Components', N'adventure-works\jillian0', N'donna0@adventure-works.com', N'279-555-0130', N'LNoK27abGQo48gGue3EBV/UrlYSToV0/s87dCRV7uJk=', N'YTNH5Rw=', N'130774b1-db21-4ef3-98c8-c104bcd6ed6d', CAST(N'2005-09-01T00:00:00.000' AS DateTime)) INSERT [dbo].[Customer] ([CustomerID], [NameStyle], [Title], [FirstName], [MiddleName], [LastName], [Suffix], [CompanyName], [SalesPerson], [EmailAddress], [Phone], [PasswordHash], [PasswordSalt], [rowguid], [ModifiedDate]) VALUES (4, 0, N'Ms.', N'Janet', N'M.', N'Gates', NULL, N'Modular Cycle Systems', N'adventure-works\jillian0', N'janet1@adventure-works.com', N'710-555-0173', N'ElzTpSNbUW1Ut+L5cWlfR7MF6nBZia8WpmGaQPjLOJA=', N'nm7D5e4=', N'ff862851-1daa-4044-be7c-3e85583c054d', CAST(N'2006-07-01T00:00:00.000' AS DateTime)) INSERT [dbo].[Customer] ([CustomerID], [NameStyle], [Title], [FirstName], [MiddleName], [LastName], [Suffix], [CompanyName], [SalesPerson], [EmailAddress], [Phone], [PasswordHash], [PasswordSalt], [rowguid], [ModifiedDate]) VALUES (5, 0, N'Mr.', N'Lucy', NULL, N'Harrington', NULL, N'Metropolitan Sports Supply', N'adventure-works\shu0', N'lucy0@adventure-works.com', N'828-555-0186', N'KJqV15wsX3PG8TS5GSddp6LFFVdd3CoRftZM/tP0+R4=', N'cNFKU4w=', N'83905bdc-6f5e-4f71-b162-c98da069f38a', CAST(N'2006-09-01T00:00:00.000' AS DateTime)) INSERT [dbo].[Customer] ([CustomerID], [NameStyle], [Title], [FirstName], [MiddleName], [LastName], [Suffix], [CompanyName], [SalesPerson], [EmailAddress], [Phone], [PasswordHash], [PasswordSalt], [rowguid], [ModifiedDate]) VALUES (6, 0, N'Ms.', N'Rosmarie', N'J.', N'Carroll', NULL, N'Aerobic Exercise Company', N'adventure-works\linda3', N'rosmarie0@adventure-works.com', N'244-555-0112', N'OKT0scizCdIzymHHOtyJKQiC/fCILSooSZ8dQ2Y34VM=', N'ihWf50M=', N'1a92df88-bfa2-467d-bd54-fcb9e647fdd7', CAST(N'2007-09-01T00:00:00.000' AS DateTime)) INSERT [dbo].[Customer] ([CustomerID], [NameStyle], [Title], [FirstName], [MiddleName], [LastName], [Suffix], [CompanyName], [SalesPerson], [EmailAddress], [Phone], [PasswordHash], [PasswordSalt], [rowguid], [ModifiedDate]) VALUES (7, 0, N'Mr.', N'Dominic', N'P.', N'Gash', NULL, N'Associated Bikes', N'adventure-works\shu0', N'dominic0@adventure-works.com', N'192-555-0173', N'ZccoP/jZGQm+Xpzc7RKwDhS11YFNybwcPVRYTSNcnSg=', N'sPoUBSQ=', N'03e9273e-b193-448e-9823-fe0c44aeed78', CAST(N'2006-07-01T00:00:00.000' AS DateTime)) INSERT [dbo].[Customer] ([CustomerID], [NameStyle], [Title], [FirstName], [MiddleName], [LastName], [Suffix], [CompanyName], [SalesPerson], [EmailAddress], [Phone], [PasswordHash], [PasswordSalt], [rowguid], [ModifiedDate]) VALUES (10, 0, N'Ms.', N'Kathleen', N'M.', N'Garza', NULL, N'Rural Cycle Emporium', N'adventure-works\josé1', N'kathleen0@adventure-works.com', N'150-555-0127', N'Qa3aMCxNbVLGrc0b99KsbQqiVgwYDfHcsK9GZSUxcTM=', N'Ls05W3g=', N'cdb6698d-2ff1-4fba-8f22-60ad1d11dabd', CAST(N'2006-09-01T00:00:00.000' AS DateTime)) INSERT [dbo].[Customer] ([CustomerID], [NameStyle], [Title], [FirstName], [MiddleName], [LastName], [Suffix], [CompanyName], [SalesPerson], [EmailAddress], [Phone], [PasswordHash], [PasswordSalt], [rowguid], [ModifiedDate]) VALUES (11, 0, N'Ms.', N'Katherine', NULL, N'Harding', NULL, N'Sharp Bikes', N'adventure-works\josé1', N'katherine0@adventure-works.com', N'926-555-0159', N'uRlorVzDGNJIX9I+ehTlRK+liT4UKRgWhApJgUMC2d4=', N'jpHKbqE=', N'750f3495-59c4-48a0-80e1-e37ec60e77d9', CAST(N'2005-08-01T00:00:00.000' AS DateTime)) INSERT [dbo].[Customer] ([CustomerID], [NameStyle], [Title], [FirstName], [MiddleName], [LastName], [Suffix], [CompanyName], [SalesPerson], [EmailAddress], [Phone], [PasswordHash], [PasswordSalt], [rowguid], [ModifiedDate]) VALUES (12, 0, N'Mr.', N'Johnny', N'A.', N'Caprio', N'Jr.', N'Bikes and Motorbikes', N'adventure-works\garrett1', N'johnny0@adventure-works.com', N'112-555-0191', N'jtF9jBoFYeJTaET7x+eJDkd7BzMz15Wo9odbGPBaIak=', N'wVLnvHo=', N'947bcaf1-1f32-44f3-b9c3-0011f95fbe54', CAST(N'2006-08-01T00:00:00.000' AS DateTime)) INSERT [dbo].[Customer] ([CustomerID], [NameStyle], [Title], [FirstName], [MiddleName], [LastName], [Suffix], [CompanyName], [SalesPerson], [EmailAddress], [Phone], [PasswordHash], [PasswordSalt], [rowguid], [ModifiedDate]) VALUES (16, 0, N'Mr.', N'Christopher', N'R.', N'Beck', N'Jr.', N'Bulk Discount Store', N'adventure-works\jae0', N'christopher1@adventure-works.com', N'1 (11) 500 555-0132', N'sKt9daCzEEKWAzivEGPOp8tmaM1R3I+aJfcBjzJRFLo=', N'8KfYx/4=', N'c9381589-d31c-4efe-8978-8d3449eb1f0f', CAST(N'2006-09-01T00:00:00.000' AS DateTime)) INSERT [dbo].[Customer] ([CustomerID], [NameStyle], [Title], [FirstName], [MiddleName], [LastName], [Suffix], [CompanyName], [SalesPerson], [EmailAddress], [Phone], [PasswordHash], [PasswordSalt], [rowguid], [ModifiedDate]) VALUES (18, 0, N'Mr.', N'David', N'J.', N'Liu', NULL, N'Catalog Store', N'adventure-works\michael9', N'david20@adventure-works.com', N'440-555-0132', N'61zeTkO+eI5g8GG0swny8Wp/6GzZMFnT71fnW4lTHNY=', N'c7Ttvv0=', N'c04d6b4d-94c6-4c5c-a44c-b449c0ac1b45', CAST(N'2005-08-01T00:00:00.000' AS DateTime))
Install the SSRS Projects in VS
Once that VS is installed, you will need to add an extension to support SSRS reports projects. In the past, you only need to install the SSDT and select the reporting services option. In the last SSRS versions, you need to go to the VS Menu and select Extensions>Manage Extensions.
Manage extension
Secondly, select Microsoft Reporting Services Project and install it. You may need to close VS to install it.