In this article we will learn how to create a basic SSRS Report. We will learn how to create a shared data source so we can use it for all the reports in our project, How to create our data set to bind columns in report.
So why we are waiting, let's start
We set our shared data source, time to create a procedure or write Sql statement to get data for report, since it is our first report so we will not use complicated procedure with different parameters but very simple Sql statement
To add report header
To add report content (supplier detail)
So why we are waiting, let's start
- Click on Start
- Click All Programs
- Expand Microsoft SQL Server 2008 folder
- Sql Server Business Intelligence Development Studio
- Click File menu
- Click New
- Click Project…
- From Project type select Business Intelligence
- From Templates: select Report Server Report
- Select folder to save and enter project Name
- Shared Data Source: where we will create our datasource
- Reports: where we will create our all the reports
- Right click on Shared Data Source Folder
- Click Add New Data Source
- It will open Shared Data Source Properties dialog
- Enter Name for data source say MyDataSource
- Select Type: since I am going to use Sql Server Northwind database so select “Microsoft Sql Server”
- Click Edit button to define the connection string
- Enter server name say localhost
- Logon to the server: Select your authentication type
- Select or enter a database name : Northwind
- Click Test Connection
- Click Ok
We set our shared data source, time to create a procedure or write Sql statement to get data for report, since it is our first report so we will not use complicated procedure with different parameters but very simple Sql statement
SELECT * FROM [Suppliers]
Now we will create our first report, we will use blank report without using report wizard, so let’s create it.- Right click on Reports Folder
- Click Add
- Click New Item, it will open Add New Item dialog
- From Templates: select Report
- Give name to report, say, Suppliers.rdl
- Click Add
To add report header
- Right click on the surface
- Click Insert
- Click Report Header
- Add Textbox to add the report header text
To add report content (supplier detail)
- From Toolbox drag a Table on report surface
- It will open a dialog to select the data source
- Select Use shared data source reference
- Select your shared data source from drop down
- Click Next
- It will open Query Designer
- Select Text from Command type drop down
- Paste our Sql statement and execute it.
- Click Finish
- Open Report Data window
- If it is not visible then open it from view menu
- Drag different columns from DataSet in table column
- If you need more columns, right click on header to add the more columns
- Select entire row
- Open Property
- Select BackgroundColor, clieck expression
= IIf(RowNumber(Nothing) Mod 2 = 0, "Transparent", "WhiteSmoke")
Here is our created report
No comments:
Post a Comment