Lesson 1: Create a Simple SSRS report (Tutorial).
Agenda of the tutorial is to create a simple SSRS report. Once we are done with the tutorial you can see that it is so easy.
Open Business Intelligence Development Studio (BIDS)
Select Menu File -> New -> Project.
New project window should appear. Ensure you have Business Intelligence Projects selected on the left side (Project types). Select Report Server Project from templates window.
Type name (SampleReportingProject), select location, Solution Name usually is the same as project name and should be updated when you type project name (name text box). Click ok to create new SSRS project.
Now that you have new SSRS Project created you should be able to view its content in solution explorer pane.
Next step will show you how to setup Shared Data Source.
Data source contains a connection string which is used to connect to your source of data. "Shared" just means you can re-use it for different reports.
To set up shared data source in Solution Explorer pane right click "shared data source" and click "Add new data source".
Open Business Intelligence Development Studio (BIDS)
Select Menu File -> New -> Project.
New project window should appear. Ensure you have Business Intelligence Projects selected on the left side (Project types). Select Report Server Project from templates window.
Type name (SampleReportingProject), select location, Solution Name usually is the same as project name and should be updated when you type project name (name text box). Click ok to create new SSRS project.
Now that you have new SSRS Project created you should be able to view its content in solution explorer pane.
Next step will show you how to setup Shared Data Source.
Data source contains a connection string which is used to connect to your source of data. "Shared" just means you can re-use it for different reports.
To set up shared data source in Solution Explorer pane right click "shared data source" and click "Add new data source".
We will use UserWindowsAuthentication (you could use SQL authentication if you have SQL username/password). Next go to Select or enter a database name. If previous options are set correctly and you have permissions and connectivity this drop down box should show you available databases.
Once you select database in our case “Movies”, we can double check connectivity by clicking TestConnection button and if is ok then select OK button.
Now we can Add New Report. In solution explorer right click reports folder and select Add New Report, then select New Item.
NOTE: "Add New Report" (with *) also allows you to create a report but using an SSRS wizard which we won't be using in this tutorial. My best practice recommendation is to create report templates and then copy/paste into new report. You will save yourself a lot of repetitive work.
At the bottom we need to type report name as “SampleReport.rdl”.
Now we can see that the report gets created and opened in design view.
Before creating dataset, create sample database Movies and run the below script to create the table we will be using.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Movies](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Title] [varchar](50) NULL,
[ReleaseDate] [datetime] NULL,
[Genre] [nvarchar](50) NULL,
[Price] [numeric](18, 0) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[Movies] ON
INSERT [dbo].[Movies] ([ID], [Title], [ReleaseDate], [Genre], [Price]) VALUES (1, N'Sangam', CAST(0x00009F9800000000 AS DateTime), N'U', CAST(100 AS Numeric(18, 0)))
INSERT [dbo].[Movies] ([ID], [Title], [ReleaseDate], [Genre], [Price]) VALUES (2, N'Hum', CAST(0x0000915400000000 AS DateTime), N'UA', CAST(200 AS Numeric(18, 0)))
INSERT [dbo].[Movies] ([ID], [Title], [ReleaseDate], [Genre], [Price]) VALUES (3, N'Sagar', CAST(0x00009F9800000000 AS DateTime), N'UA', CAST(200 AS Numeric(18, 0)))
INSERT [dbo].[Movies] ([ID], [Title], [ReleaseDate], [Genre], [Price]) VALUES (4, N'Saudagar', CAST(0x00009F9800000000 AS DateTime), N'UA', CAST(100 AS Numeric(18, 0)))
INSERT [dbo].[Movies] ([ID], [Title], [ReleaseDate], [Genre], [Price]) VALUES (5, N'Avatar', CAST(0x00009F9800000000 AS DateTime), N'U', CAST(400 AS Numeric(18, 0)))
INSERT [dbo].[Movies] ([ID], [Title], [ReleaseDate], [Genre], [Price]) VALUES (6, N'Inception', CAST(0x00009F9800000000 AS DateTime), N'U', CAST(400 AS Numeric(18, 0)))
INSERT [dbo].[Movies] ([ID], [Title], [ReleaseDate], [Genre], [Price]) VALUES (7, N'Devils Advocate', CAST(0x00009F9800000000 AS DateTime), N'A', CAST(400 AS Numeric(18, 0)))
INSERT [dbo].[Movies] ([ID], [Title], [ReleaseDate], [Genre], [Price]) VALUES (8, N'Blood and Wine', CAST(0x00009F9800000000 AS DateTime), N'A', CAST(400 AS Numeric(18, 0)))
SET IDENTITY_INSERT [dbo].[Movies] OFF
To create new dataset open "Report Data" pane if it is not there use view menu. Right click datasets folder and click Add Dataset.
Your Data Set is ready. Now we can create simple report table. Open Toolbox (use view menu or icon on toolbar).
Drag and drop a text box and a table item into design area.
Finally to run the report click preview tab.
See below the end result.
Conclusion:
SSRS report is created and it in just few minutes and very easy.
Related topics:
Lesson 2: CREATE A SSRS REPORT WHICH EXCEPTS INPUT PARAMETER (TUTORIAL)
Lesson 3: CREATE DRILL DOWN VIEW IN SSRS (TUTORIAL)
Lesson 4: NAVIGATING BETWEEN SSRS REPORTS (TUTORIAL)
Lesson 5: WORKING WITH SUB REPORT IN SSRS (TUTORIAL)
Lesson 6: WORKING WITH EXPRESSIONS IN SSRS (TUTORIAL)
Lesson 7: WORKING WITH GRAPHS AND INDICATOR IN SSRS (TUTORIAL)
Lesson 8: MISCELLANEOUS OPTIONS IN SSRS (TUTORIAL)



















No comments:
Post a Comment