Вы находитесь на странице: 1из 68

An Introduction to SSRS

In this set of tutorials, we will be learning microsoft sql server 2008 reporting services. As far as
possible we will use the adventure works database, which is available here. We will also walk
through various ms sql server 2008 tools. This set of tutorials, is designed for anyone with absolutely
no experience in business intelligence SSRS or sql server reporting services. We will also walk
through sql reporting services configuration, creating your first report, deploying, security etc.

What is SSRS?

SSRS or SQL server Reporting Services which is also called Microsoft SQL
reporting, is a component of the Microsoft BI stack.
The Microsoft Business Intelligence Stack mainly consists of SQL Database
Engine, SSRS, SSAS, SSIS and other tools
SSRS is a set of readymade tools, that helps you to create, deploy and manage
reports.
You can extend reporting functionality using C# and VB as programming
languages.
Microsoft SSRS or Business Intelligence SSRS, lets you create very rich reports
(Tabular/Graphical/Interactive/free-form) from various datasources with rich data
visualization (Charts, Maps, sparklines).
All these reports can be viewed via a web browsers.
SSRS allows are reports to be exported in various formats (Excel, PDF, word etc)
SSRS allows reports to be delivered via emails or dropped to a share location in
an automated fashion.
SSRS provides a host of security features, in order to control, who sees which
reports etc.
You can download some samples from here.
Next, lets look at how to install SSRS and get you started.

SQL Server Reporting Services Installation


Lets move forward with getting to know how to install sql server 2008 reporting services. Please
note, most of the steps are the same for installing sql server reporting services 2005.
Below are the steps to install SQL reporting services 2008 with express Database.
Step 1 : Download the 64 bit or 32 bit version of SQL 2008 Express with advances services
from here .
Step 2: Right Click on the downloaded file and "Run as Administrator".

Step 3: The files will extract itself.

Step 4: In case you get a pop-up saying "This program has compatibility issues", click Run Program.

Step 5: You should be getting a progress screen.

Step 6: The SQL server Installation Center should fire up.

Step 7: Select installation on right hand tab and click on "New SQL server stand -alone installation"

Step 8: SQL server will load the setup files.

Step 9 : Click OK, it should take you to next page.

Step 10 : Click Install.

Step 11: Click next, then again next.

Step 12 : Click next

Step 13 : In feature selection, make sure you select 'Database Engine Services' and 'Reporting
Services'

Step 14 : Next, select Named Instance and give it any name (you can also choose Default instance)

Step 15 : Click next

Step 16 : Select Mixed Mode --> enter in any password --> and specify SQL server admins.

Step 17 : Click next, and select 'Install, but do not configure under Reporting Services configuration.

Step 18 : Click Next

Step 19 : Click Next

Step 20 : Click Install.

Step 21: After Installation is done, click next

Step 22 : Click Next.

Your installation is almost complete. In order to start using SSRS, you need to perform a few more
steps.

Step 23: Click Start --> All programs --> Microsoft SQL 2008 --> Configuration Tools --> Reporting
Services Configuration --> select your instance
Step 24 : Click web service URL on the left hand side and click the apply button.
Step 25 : Click database on the left hand side, select change database --> create a new report
server database and complete the steps.
Step 26 : Click report manager URL and click apply (Note down the URL displayed. It should be of
the form http://machinename/reports)
Step 27: open IE and hit the noted down URL
Step 28 : You should get a screen like this.

That's all. We are all set. Let's install some sample databases and get started learning SSRS 2008

A step-by-step example of configuring


a reporting services point for HTTPS in
System Center 2012 Configuration
Manager
J.C. Hornbeck
23 Jul 2014 12:03 PM

~ Rafid Ali
Hello Everyone, Rafid Ali here with another support tip for you on configuring a ConfigMgr
2012 reporting service point for HTTPS. I have typically seen this requirement when the
ConfigMgr site is configured to only accept HTTPs client communication, so to improve
reporting security, here is how to setup your reporting services point to use
HTTPS as well.

Introduction to reporting in Configuration Manager


Reporting in System Center 2012 Configuration Manager provides a set of tools and
resources that help you use the advanced reporting capabilities of SQL Server Reporting
Services (SSRS) and the rich authoring experience that Reporting Services Report Builder
provides. Reporting helps you gather, organize, and present information about users,
hardware and software inventory, software updates, applications, site status, and other
Configuration Manager operations in your organization. Reporting provides you with a
number of predefined reports that you can use without changes, or that you can modify to
meet your requirements, and you can create custom reports.
In this example, we will use a scenario where my Report Server is at a remote location
hosting SSRS (SQL Server Reporting Services) and the ConfigMgr Site Database is local.
However, you can have your Report Server local as well.

Requirements
A Certificate (with Server OID or Web Server Certificate) on the Report Server where SQL
Reporting Service is hosted.
NOTE The Report Server instance and ConfigMgr Site Database instance can be on different
servers but they must be the same version in order to communicate properly.

The Steps Involved


1. Issuing a Certificate and Enrolling it on Report Server.
2. Configuration of the Report Database and URLs
3. Installation of the Reporting Services Point role.

Step 1: Issuing a Certificate and Enrolling it on Report Server


We need a certificate (with Server OID or Web Server Certificate) on our Report Server. The
Subject Name of the Certificate should be the FQDN of Report Server as the URLs will be
created using the same name. You can ask your PKI expert to provide you with this
certificate on the Report Server or you can refer to the article below for information on
creating, issuing and requesting the certificate.
Configure the Web Server certificate template: http://technet.microsoft.com/enus/library/ee649187(v=WS.10).aspx
Request a Certificate: http://technet.microsoft.com/en-us/library/cc730689.aspx
To verify certificate enrollment, check the Personal Store of your Report Server and verify
with the Template Name you provided initially while issuing the certificate.
NOTE Make sure that Issued To has your Report Server FQDN, as the URLs will be created
using this name.

Step 2: Configuration of the Report Database and URLs


Open the Reporting Services Configuration Manager by connecting to the correct Instance.
Verify that the version of Reporting Service Instance is the same as SCCM Database
Instance. If not, upgrade the Reporting Service Instance first.

Go to Web Service URL. You will find that the URL is already created on Port:80 but is not
active. To make it active click on Apply.
NOTE You need to make the URL active only if Reporting Services is not configured during
installation of SQL Reporting Services.

Do the Same for Report Manager URL:

Next select Database.


NOTE If the Database is already created and configured then skip this part (Database
Configuration), else proceed accordingly for configuring the Report Server Database.
In my case the Database named ReportServer_New is already created and configured but I
am proceeding with configuration of a New Database just so that you can see how this is
done.
Click on Change Database:

Select Create a new report server database:

Provide the server name where the SCCM Database instance is hosted:

Provide the name of Report Server Database you want to create. Here I have provided the
name ReportServer:

Provide the credentials as per your environment configuration. I suggest Local System as a
good one to use.

Finish the configuration:

Once the Report Database is created you can verify the same by opening the SQL
Management Console on the Site Database Server:

NOTE You can also verify the version of SQL Instance on which the SCCM Site Database is
hosted and compare it with SQL Reporting Services Instance hosted on the Report Server.
Now go back to Web Service URL to configure it for HTTPS. Click on Advanced..:

Remove the TCP Port 80 (HTTP) identity and add the SSL identity by clicking on Add:

SSL Port 443 will be already selected. Select the Web Server certificate we previously
enrolled:

This will create the required HTTPS URL automatically that you can verify here:

Click OK to finish the Web Service URL configuration:

You will find that the HTTPS (Web Service) URL (https://<Report Server
FQDN>:443/ReportServer) is created as per your Report Server FQDN:

Click on the URL to verify that its running and verify that its connecting via HTTPS:

Now do the same for Report Manager URL:

You will find that the HTTPS Report Manager URL (https://<Report Server
FQDN>:443/Reports) is created as per your Report Server FQDN:

Step 3: Installation of the Reporting Services Point role


Go ahead and add the Reporting Service role on the Report Server hosting the SQL Reporting
Services.
IMPORTANT While adding the role make sure that you specify the following:

SCCM Site Database Server Name at Site Database Server Name (Example:
PRI.contoso.com)

SCCM Site Database Name at Database Name (Example: CM_MUM)

Reporting Service Instance Name at Reporting Services Server Instance


(Example: MSSQLSERVER)

Set the User Name

Below is the screen shot for the same:

Once the role is added you can verify the initiation of role installation and start of the
Bootstrap Service in Sitecomp.log. Do this by looking at the Site System name (i.e. Report
Server):

Verify that the role was added successfully by looking in SRSRPsetup.log on the Site System
(located at \\<Drive>\SMS\Logs):

If the role installation is successful, look in the SRSRP.log created at the same location and
verify the HTTPS URL you created. Also verify the SSRS Instance Version as well as the
creation of the Source Folder and Data Source:

Once all of the above things are verified and configured, it will start deploying Reports and
creating respective folders of those reports:

Once all the reports are deployed it will check the SRS Web Service health and keep
checking at regular intervals:

Once all of the reports deployed successfully, you can verify the URLs in the ConfigMgr 2012
console as well:

Now you can go ahead and start running the reports from the ConfigMgr 2012 console using
HTTPS mode by using the HTTPS URL.

Summary
In Step 1 we issued a Web Server certificate and enrolled it on the Report Server, with the
configuration of the URLs being the most important step that you need to focus on. In Step 2
we configured the URLs and verified that they were running properly, and that the Report
Server Database was created successfully under the Master Database. Once the SSRS
configuration was complete we then proceeded towards Steps 3 for the configuration of
Reporting Service Point Role on our Site System (hosting the SSRS). We closely looked into
the desired inputs (with examples) in the wizard while adding the role, we went through the
logs and verified the configuration settings that Configuration Manager 2012 verifies before
installing the Role, then we verified the successful installation of role and deployment of
reports on Report Server.

Installing Sample databases ( AdventureWorks )


Next, lets install some sample databases for us to work with. One of the most commonly used
databases is the SQL adventureworks database. SQL server adventureworks database download is
available here.
Once you download the database, lets look at how to setup sql database.
Step 1: Install your downloaded database (sql server 2008 sample databases download), by
choosing the correct instance name.

Step 2: After installation, open SSMS --> your instance name, then check if the below databases are
visible.

Step 3: You can also install some sample reports from here

REPORT

D ESCRIPTION

Company
Sales 2008

Adventure Works Cycles sales by quarter and product category. This report
illustrates the use of a matrix data region that provides drilldown from
summary data into detail data by showing and hiding rows. This report also
illustrates the use of background images.

Employee
Sales
Summary
2008

Adventure Works Cycles sales for an individual employee. This report includes
Sales Comparison and Current Month Sales Comparison charts in addition to a
Current Month Order Summary table with drillthrough to individual orders.
This report illustrates the use of multiple datasets, charts, tables, drillthrough,

and dynamic parameters.


Product
Catalog
2008

The Adventure Works Cycles full product catalog with pictures. This report
illustrates the use of embedded images, database images, page breaks, page
footers, tables, conditional formatting, and a document map.

Product Line
Sales 2008

Adventure Works Cycles top five sales people and stores. This report
illustrates a dataset with queries containing the TOP clause. It also illustrates
the use of tables, charts, multivalued parameters, end-user sorting,
calculated fields, and drillthrough links.

Sales Order
Detail 2008

Detail of an individual Adventure Works Cycles order. This report can be


accessed as a drillthrough report from the Employee Sales Summary and
Territory Sales drilldown report. This report illustrates the use of lists, tables,
parameters, and expressions.

Territory
Sales 2008

Adventure Works Cycles sales by territory. This report drills down through
salesperson and order number with drillthrough to individual orders. This
report illustrates the use of a table data region that provides drilldown from
summary data into detail data by showing and hiding rows. This report also
illustrates the use of drillthrough links and conditional formatting.

Store
Contacts
2008

AdventureWorks store contacts. Each store can have one or more store
contacts. This report is a subreport used in Sales Order Detail to show all
contacts for a store and a drillthrough report for the Product Line sales chart.
The border style for the table is None so that borders do not appear in the
main report. Note that the page header and footer content are not included
when the report is a subreport.

Sales Trend
2008

AdventureWorks sales trend analysis that compares year over year (Y/Y)
growth for products by category and subcategory. This report illustrates the
following features: a Tablix with conditionally hidden static columns, repeat
column and row headers, and KeepTogether static Tablix member; the
aggregate function Previous that calculates Y/Y trends; custom code;
conditional font, background cell color, KPI images, and drillthrough
parameters.

Create the simple SSRS


Now that you are all set with installing SSRS 2008 and some SQL server adventure works database,
Let us proceed with creating our first SSRS report, deploying the same and viewing in the web
browser. For report development , we will use Microsoft Business Intelligence Development studio.

Quite often people ask me, how to install Business intelligence Development studio. Installing
business intelligence Development studio, is as simple as adding components to an existing SQL
installation. Just run the SQL setup again, and choose add features to an existing installation, and
choose select the required features you need.
Lets follow a step by step process to create your first Business Intelligence Report.

Step 1: Open Business Intelligence Development Studio (BIDS) (Start --> Microsoft SQL server 2008
--> SQL server Business Intelligence studio
Step 2: Click File --> New project --> Report Server Project Wizard. Give any name and location.

Step 3: Once you click OK, you will be presented with the following screen.

Step 4 : Click Next. Now configure your connection string. I have chosen the type as 'Microsoft SQL
server'

Step 5 : In this step, you need to enter the query for the data, that you need the SSRS report to be
populated with. You can also use the query builder.

Step 6 : Click on query builder, and click on the right most top icon, to add tables

Step 7: Select the necessary table, and verify your query, then click the (!) icon to see the result of
the query after execution.

Step 12 : Choose a style, and click next.

Step 13 : Choose a deployment location. It will be in the form (http://machinename/Reportserver)

Step 14 : Click Next.

Step 15 : You can preview the report in Business Intelligence Development Studio.

Step 16 : Now, Right click the project , and click deploy.

Step 17 : After successfully deploying the project, open up IE, and hit http://machinename/reports

Step 18 : Click on your report to open it.

Congratulations! You have made your first SSRS report.

SSRS Configure Deployment


Configure your deployment
Build configurations allow you to specify which environment to which you want to deploy reports.
For example, if you have a Development, Functional Test, Stage and Production environment,
you will want to create a build configuration each said environment. I would name them Dev,
Test, Stage, Prod.
1.

Build your project

1.
2.
1.
2.
3.

1.
2.
3.
4.

Right-click on your project and click Build


Make sure it succeeds and doesn't throw any errors or warnings
If it does try to resolve errors / warnings and build again.
Set up your environment(s)
Set up the configuration for your environment(s)

Click on the drop down Configuration Manager window in the toolbar


Click Configuration Manager
Under the Active solution configuration: drop down select <New>
Name your environment

1.
i.e. Test, Dev, Stage, Prod
2.
NOTE: Name your environments so that you will know exactly which
environment it is going to. The use of Test, Dev, Stage, and Release are highly recommended
5.
Select the drop down under Copy settings from: to copy settings of an existing
configuration and then tweak.

1.
I highly recommend you do this
6.
Make sure the checkmark is marked on Create new project configurations
7.
Click OK
4.
In the Solution Explorer navigation pane, right-click on your project and select
Properties.
5.
The Project Property Pages window will open and will show Configuration options.
6.
On Configuration: Ensure that the dropdown is on the desired configuration
1.
7.
1.
2.

i.e. Test, Dev, Stage, Release, etc.


There are three options under the General tab: Build, Debug, and Deployment
On Build change the OutputPath to bin\EnvironmentName
i.e. bin\Test

1.
If it is already that way, don't worry about it, otherwise this will cause you
grief if you have two configurations pointing to the same output folder
3.
Under Deployment you will see the following properties:
1.
OverwriteDatasets: false
2.
OverwriteDataSources: false
1.
These two are defaulted to false because it is safer. Whenever
you deploy your project for the first time these will be deployed. HOWEVER every time after
your first deployment, these will not be updated. This is to ensure that your connections do not
get overriden.
2.
If you change these properties to true then they will override each
time you deploy them.
3.
I would keep these properties set to false, especially your
DataSources. If you find yourself updating either your Datasets or your DataSources then you
can change this property.
4.
Under Deployment change the following items:
1.
Target Dataset Folder: Your Dataset Location
1.
i.e: /ProjectName/DataSets
2.
Target DataSourceFolder: Your Data Source Location
1.
i.e.: /ProjectName/Data Sources
3.
Target Report Folder: Your Report Location
1.
i.e.: /ProjectName/Reports
4.
Target Report Part Folder: Your Report Part Location
1.
i.e.: /ProjectName/Report Parts
5.
Target Server URL: Your Server URL Location
1.
i.e.: http://ServerName.domainname/SSRSReportServer
6.
Target Server Version: Your Server version (drop down menu)
1.
i.e.: SQL Server 2008 R2 or later
5.
Change Configuration: drop down to other environments
1.
i.e. Test, Dev, Stage, Release, etc.
6.
Click OK

How to Deploy in SSRS


1.
If you have followed the steps in Configure Deployment, then this will be one of the
easiest things you will do. And you will love it.
1.
environment

Click the Configuration Manager drop down in your toolbar and select the desired

1.
NOTE: This is critical. Make sure you select the correct environment. You
should have already have configured this before this step. If you don't think you have, please go
configure it.

2.

There are three options for deployment:

1.

Deploy full project

1.
Deploy

In your Solution Explorer, right-click on your project and click

2.

Deploy one project item

1.
click Deploy

In your Solution Explorer, right-click on a specific project item and

1.
DataSourceName.rds
3.

i.e. DatasetName.rsd, or ReportName.rdl, or


Deploy multiple project items

1.
and click Deploy

In your Solution Explorer, use Ctrl and select multiple project items

3.

Your Output will show your Build and Deployment.

4.

Here is a successful output:

------ Deploy started: Project: ProjectName, Configuration: Stage -----Deploying to ReportServerUrl


Deploying report '/ProjectName/ReportName'.
Deploy complete -- 0 errors, 0 warnings
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========
You have now deployed! You can verify it by clicking on the ReportServerUrl in the output

How to enable and configure interactive (dynamic) sorting on your SSRS


reports.
In reporting server you can build reports which are sorted in a specific way. However sometimes it
depends on the usage of the report on which column a report should be sorted. User A want to sort it on
column X and user B wants to sort it on column Y. To configure dynamic sorting on your SSRS reports
you need to do the following:
1.

Open your SSRS report.

2. Select the header of the column on which you want to enable interactive sorting.

3. Open the properties of the Text properties window.

4. Tick enable interactive sorting on this text box.


5.

Select the columns of the dataset you want to sort on.

6. Repeat previous steps for all columns on which you want enable interactive sorting.See the red
circles for which columns interactive sorting is enabled.

Enjoy building nice reports.

SSRS export to PDF in landscape format.

In reporting server you have the option to export your reports to PDF format. By default your reports are
generated in the portrait format. When building your report the body will automaitically resized when you
add report items which did not fit. After deploying your report, it renders correct in your
browser. However after exporting the report you see that the report is exported in the portrait format.
This is not nice and generated extra pages. This can be avoided to export the PDF in landscape format. To
export your reports to PDF format in landscape format, you need to do the following:

Retrieve the properties of your report. (Right mouse click, just outside the body of the report).

Set the width of the report to the landscape size of your A4 paper: 29.7 cm
Set the height of the report to 21 cm.

To avoid extra blank pages during export, the size of the body should be less or equal to the size of the

report - margins.
Set the width of the body to 26.7 cm (29.7 -1.5 - 1.5)
Set the height of the body to 18 cm (21 - 1.5 -1.5)

Your report is now defined in landscape which will result in generated PDF exports in the landscape
format.

Enjoy building your reports.

steeve said...
I tried your solution and it doesn't change anything.
MAY 14, 2010 AT 8:10 PM

Andr van de Graaf said...


Steeve, can I help you. Do you have a skydrive from which i can download the report to look what
is wrong?

MAY 14, 2010 AT 8:45 PM

ALM said...
The page size needs changing to 29.7 x 21 cm in the report properties also not just the body size
DECEMBER 6, 2010 AT 3:04 PM

eva said...
I am using Report builder 3.0 to create the report. I don't see any property option there.
JANUARY 6, 2011 AT 11:05 PM

Andr van de Graaf said...


Eva,

You can enable the propertie window in report builder 3.0. by default it is not enabled. Select in
teh menu View, Now you can select (tick) Properties. After enableing this you will get the
propertie window.
Another way of doing this. Put your mouse on the blue part just outside your report and do right
mouse click and select report properties. Or in the report, right mouse click and select Body
properties.

Success in configuring your reports in landscape


JANUARY 7, 2011 AT 2:07 PM

Slideshow Bob said...

Thanks. Very simple and works fine.


APRIL 14, 2011 AT 12:42 PM

Veerapandiyan.K said...
Hai Andre van - How to export pdf file portrait format A4 size from SSRS report - Please Help

-Veerapandiyan
DECEMBER 8, 2011 AT 12:38 PM

Gina Cronican said...


This works for the report when you have VS2010 loaded. Any ideas when justRedistributable
Report Viewer is installed and not VS2010?
NOVEMBER 26, 2012 AT 3:24 PM

oliyaithedi said...
This comment has been removed by the author.
MARCH 18, 2013 AT 12:07 PM

oliyaithedi said...
thanks it's working fine
MARCH 18, 2013 AT 12:07 PM

Paul Kern, PMP said...

So, so very helpful! ... SSRS is a great tool, eliminating ad hoc queries by support, and developers
spending time on reports. But this 3.0 tool leaves a bit to be desired for ease of use!
JUNE 20, 2013 AT 1:11 AM

Koen Verbeeck said...


When calculating the size of the body, don't forget to take the header and footer height into
account as well!
DECEMBER 12, 2013 AT 1:50 PM

Stu Schmied said...


I found another 'fix' which required changing the config file that was extremely difficult. I am glad
I found this one (altho I did feel stupid once I saw it)!!

Thanks for posting it!


MAY 15, 2014 AT 9:57 PM

Stu Schmied said...


I found another 'fix' which required changing the config file that was extremely difficult. I am glad
I found this one (altho I did feel stupid once I saw it)!!

Thanks for posting it!


MAY 15, 2014 AT 9:58 PM

Unknown said...

Can some one help me to fix these issues in SSRS report.How and where?

Make it legal size


Set margins to narrow setting
Centering all the columns except the dollar amount column
Reduce the font size to 8 for the body and 14 for the heading
JUNE 24, 2014 AT 8:34 PM

rani irsan said...


Thank you so much. It works fine.
AUGUST 28, 2014 AT 5:39 AM

Ayah Nsour said...


This comment has been removed by the author.
NOVEMBER 27, 2014 AT 12:44 PM

Unknown said...
Thank you very much!
works a charm...

Cheers,
Arun
DECEMBER 9, 2014 AT 11:04 PM

Fahad Mchumi said...

Thanks man, really helpful.Your article has en-lighted crucial and important ways to work with
report builder. Many thanks, GOD bless you.
FEBRUARY 13, 2015 AT 12:57 PM

Roja Rani said...


Hi,
I'm facing an issue when my ssrs report is exported to pdf from sharepoint. The text box data is
aligned to Right. Because of that the last letter is getting truncated. Could any please suggest to fix
the issue.

Thanks

Вам также может понравиться