Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 52

SQL SERVER REPORTING SERVICES

(SSRS)
SQL Server 2005
REPORTING SERVICES
The ability to extract and present information from a database in any no. of

different Combinations of format, timing, security and outputs, with minimal

hassle and to the Widest possible audience.

Uses of Reporting Services:


 Reporting services can be a valuable tool in any no. of instances.

 Reporting services can be used to prepare and distribute information


to users who need Reports to assist in making decisions as well as
assessing threats and opportunities , whether on a routine or adhoc
bases.
REPORTING LIFE CYCLE

Life cycle consists of 3 activities:


 Report Authoring
 Report Management
• Defining security
• Setting properties
• Scheduling activities
• Enabling server features
• Creating shared schedules and shared data sources
 Report Delivery
REPORT AUTHORING
• Reporting service has 2 primary authoring
tools
Report designer
• Consist of Report wizard which automate large
part intended of data processing professionals.
Report builder
• This provides ad hoc reporting from relational
data sources and is intended for users who
know their data but not data processing.
Report Management
• Consist of two tools
• SQL Server Management studio OR Report
Manager
– Defining properties
– Setting properties
– Scheduling activities
REPORT DELIVERY
• RS provides two basic methods of
accessing an delivering reports
• On demand access means that users
utilizes a report viewing tool(e.g. Report
Manager, Browser, Share point web part)
• Subscription based access. A Report
server administration creates a report that
is automatically delivered to a
destination when an event triggers it.
Key terms:
Report Definition: It contains information about the query
format and other design elements needed to run the Report.

Published Report: they are created and saved in Report builder


can be edited or saved back to the report server.

Rendered Report: In order to view publish report it has to be


processed by a report server called rendered report which
contains data and layout information.
Parameterized Report:
This Report type makes use of input values to complete the report

Linked Report: It is used whenever you want to create additional


versions of an existing report.

Report snapshot: This type of reports contains data captured at a


single moment in time.

Report Model: Used for creating Adhoc reports and provides user
friendly discription of underlying data base.
Key Components:
– Report Server
– Report Manager
– Report Designer
– Report Builder
– Model Designer
REPORT SERVER
• A report server is the main processing
component of Reporting Services. TH
principal functions of a report server are to
process reports and to make reports available
of access either on demand or subscription. It
is also where the various reports are manages
and administered.
REPORT MANAGER
• This is web-based access and management tool
that runs in internet Explorer. Report Manager
can be used to a administer a report server
remotely through HTTP. Report manager is
also used report viewing and navigation. Key
tasks performed with report manger include
browsing report server folder viewing reports
and their properties, subscribing to reports and
a number of management and administrative
tasks.
REPORT DESIGNER
• Report designer is based in Visual studio and
accessed through BIDS. Report designer
allows you to create tabular,matrix, or
freeform reports. And first two can be created
using Report Wizard. Report designer was
intended for use by IT professionals and
application programmers.
CREATING REPORTS
 Using Report Designer
• Creating A Report with Report Wizard
1 Launch business intelligence development in
(BIDS) from
START -> PROGRAMS->MS SQL
SERVER2005
2 From File menu->New->Project->New Project
(cont,,)
3.Confirm that Business Intelligence projects is selected
in the left pane and Report server Project wizard is
selected in the right pane.
4.In the Name text box type Report Wizard Example,
accept the default location and solution name, and
Click OK.
The Report Wizard will start Automatically.
5.Click Next to go to the select Data Source
Dialog Box. Select the New data source Radio button,
that is set to SQL Server. click edit button to open the
connection properties Dialog.
6.In Server Name text box, type Local host/ use
drop down list to select a server .
7.Logon to the server ,confirm the use windows
authentication radio button is selected.
8.Connect->Database, in the “Select or Enter
Data Base name” select the Adventure works
DW database. you can use the test connection
button to confirm you are connected to both
the server and the database.
9.Click OK, To return to select->Data source
Dialog Box. Confirm that local server and
adventure-works DW database are listed in the
connection string->Next.
10.In Design the Query dialog box->Query
Builder to Design a Query.
USE Adventureworks DW
SELECT FirstName,LastName,
DepartmentName,VacationHours,SickLeaveH
ours FROM DimEmployee
11.Click Next->Open->Report Dialog Box.
confirm that the radio button Next to Tabular is selected and
click next.
12.In the design table you see 5 selected fields from the
adventureworks DW database on the left side of the page
(available fields) you see 3 buttons page, group and details
used for specifying fields to be added,4th button to remove the
fields. Highlight the departmentName field and either click the
group button or drag into group box. Add the Firstname,
Lastname, VacationHours, SickLeaveHours fields into the
details box. You can change the order of fields by highlighting
them and dragging in the list.Rearrange the details display in
the field list so that last name appears first,click next.
13.Choose the table layout dialog box, A variety of
options , Including whether to allow drill down and to
improve sub totals.
click next.
14.Choose the table style dialog window, select
corporate. click next.
15.Choose deployment location dialog window , Accept
default location for the report server and deployment
folder on the server . Click next.
16.On completing the wizard page, name the report
available Employee vacation and sicktime by
department. Review the contents of the report
summary to confirm entries are correct. mark the
preview report check box and press finish.
17.After a few moments the report is processed
and a preview displayed in BIDS. note also
that the report has been added to the reports
folder under reportwizardexample in solution
explorer.
Modifying a Report

1.Suppose you decide that you would like the available


vacation hours report to sort employees by last name
as well as group by department.
2.Modify a report layout is also relatively simple. select
the layout tab and then the body section of report.
3.Click on title and change it from available Employees
vacation and sick time by dept to employee vacation
and sick time. when done, the report layout should
appear .
4.You can also use the individual property sheets
to adjust and modify individual fields and
report components. these properties includes:
 Display name
 Associated tool tips
 Navigational elements
 Font type, size, color, weight, decoration
 Sorting
 Actions
 Placement on page
 Alignment
 Back ground and foreground colors
CREATE A REPORT USING REPORT DESIGN

Although Report Wizard will probably be able to address most of your


needs, it has limitation. For examples, Report Wizard cannot be used to
create freeform reports. In those cases you will need to create reports
using designers. You can use this tools to create reports in a number of
different format and elements such as :

•Textboxes
•Tables
•Matrices
•Lists
•Images
•Subreports
•Charts
CREATE A SIMPLE FREEFORM REPORT USING REPORT
DESIGNER

1. Lunch BIDS from start > Program > Microsoft SQL Server 2005.
2. From the file menu select New > Project to open the new project
dialog box.
3. Confirm the business intelligence project is selected in the left pane
and Report Server Project is selected in the right plane.
4. In the name text box, type Report Project Examples, accept the
default location and solution Name, and click O.K
5. In the solution explorer, right-click Report Project Example and
select Add > New Item from the pop-up menu.
6. In the Add New Item dialog box, select report.
7.In the Name text box, enter Report Project Example.rdl ands click. Add
8. In order to create a report there needs to be associated data. We will
associate the AdventureWorkDW database with the report. At the
top of the Report Designer Window, first make sure that the data
tab is selected
9.In the dataset drop down list , Select< New Dataset..> to open the data
Source dialog Box. Accept the default name and ensure that
Microsoft SQL Server is listed under type. Then, click the edit
Button
10.In Server Name text box type localhost or use the drop down button to
select a server.
11.Under “Log On To The Server”, confirm the user window
Authentication radio button is selected.
12.Under “Connect to a database “ in the “selected or enter a
database name,” box select the AdventureWorkDW Database.
You Can use the test connection button to confirm you are
connected to both the server and the database.
13.Click OK to return to the select the Data Souse Dialog Box.
Confirm that the local server and AdventureWorkDW database
are listed in the connection string. Click Next to return to
Report Designer.
14.Now you’ll create a simple query for the data set .In this case we’ll
use the same query as ewe did with the report Builder examples
above.
Use AdventureWorkDW
Select
firstname,lastname,departmentname,vacationhours,sickleaveho
urs from DimEmployee
15. Now you’re read to create the report layout. In the view pane, click
the layout tab to show the blank report grid in the layout . You can
resize the report grid by moving the mouse to a side or bottom edge
and clicking and dragging when pointer charges to a double headed
error.
16.Open the text window by clicking on the tools icons on the menu or
selecting of view > toolbox. Also ensure that the database view is active
so that you can access the fields . If not you can open it by selecting
View > Database or pressing the Ctrl-Alt-D Keys.
17.In the examples you’ll create a simple list report showing the total
number of vacation and sick leave hours per department. In the
Toolbox window ,select the list item and double click it. Then, expand
the controls so it is the same width as the grid and about eight grid
points high.
18. Select the departmentanme fields from the dataset tab and place it
on the left side of the layout.
19. Right click inside the list box. Select properties from the pop-up
menu. In the list properties dialogs box, select the general tab and
click the Edit details group button.
20. In the details Grouping windows , in the Expression list, select
=Fields! Departmentname.Value so that the values are summarized
by department.
21. Under the sorting tab, select=Fields! Departmentname.Value and
Ascending direction to sort the department names alphabetically.
22. Click OK twice to return to the Report Layout Window. In the
Dataset Window select Vacation Hours and then the sickleaveHours
and drag them to the right of the departmentNameBox.
23. To change the appearance of the font and basic setting in the
DepartmentName textbox select the text box and click on the
properties icon. Expand font and set FontWeight to bold.
You can also change many, but not all, design properties by selecting the
controls, right clicking, and selecting properties from the pop-up-menu.

24.Before proceeding further, select file > Save all from the menu.
25. Click on the Preview Tab, the result should look like those display in the
graph.
As you can see, the report is lcking many of feature you might expect, such
as column heading and so forth.Creating and using these elements
depends on your need and how they are reflected in the individual
report design. Adding the various design elements is not difficult but a
full review of all these feature is the scope the scope of this boo.
You can also add parameters to a report to manipulate the data report
contains. Reports parameters can be used to pass values to an
underlying query, to pass vales to a filter, or as variable for calculating
data within the report. You can use parameters to add sorting to a
report. Typically the report present the user with a box to fill in a
value when he or she runs the report, but the report can also be
automatically applies default parameters that doesn't required any
direct user input.
To add a parameter to the
ReportProjectExample report
1.From the menu bar, Select report ->Report Parameter .Click Add.
2. In the name box ,type Parameterexample1.
3.In the data type box, you can use the drop-down box to choose from
Boolean , Datetime,Integer,Flooat and string data. Leave the string
setting.
4.Next, Type Text Next To Parameter text box in the prompt box. When a
user run a report the text in the fields appear next to the parameters
text box.
5.Allow the parameter to contain a blank value by selecting Allow Blank
value.
6. In Available Value, select Non-queried. This allow you to provide a
static list of values from which the users can choose a value. If you had
selected from Query, it would provide a dynamic list from a query.
The label property contains the text display to the users, while values is
the values passed on to the report server for the parameter. Create
three labels, Examples 1, Examples 2 and Examples 3 and assign them
vales of 1,2,3.

Note: If from query Is selected ,then text boxes for the dataset ,vales
fields, and label fields are shows instead. The data set used for this
option is normally specifically created for the particular report
parameters.
7.In the Default vale section ,you can select.
• Non – queried to provide a static default vales.
• From query to provide a dynamic default value from a query
• None to provide no default value
If you select either Non-Queried or from query you will be prompted to
provide the default values. Select None. Press OK.
Creating a standard subscription with file
share delivery

Using report manager:


1.Open Report manager and open the product line sales report in
the adventureworks sample reports folder.
2.Click new subscription.
3.From the delivered by drop-down list select report server file
share.
4.Type standardsubscriptionexample as the filenames.
5.In path specify the file share you want the report delivered to.
6.In render format, select PDF from the list, or another format if you
prefer.
Creating a standard subscription with file
share delivery

7.Specify the username, and password with sufficient permissions to access


the file share. These credentials will be used each time the subscription is
run.
8.Choose as appropriate from overwrite options your choices include
overwrite an existing file with a new version, do not overwrite the file if a
previous user exists and increment file names as newer versions are added.
9.In the subscription processing options section, mark the radio button next to
“when to scheduled report run is complete. ”Click select schedule to open
the schedule details window.
10.Select once and enter a time to run the report. click ok.
11.Accept the values in the report parameter values section and click ok.
Using Management Studio

1.Open the report server in management studio and


navigate to product line sales report under
home/adventureworks sample report.
2.Expand the product line sales tree.
3.Right-click the subscription folder and select new
subscription from the pop-up menu.
4.Navigate through the general,scheduling,and parameters
pages and specify the various setting as you would in report
manager.click ok.
Configuring report server for e-mail delivery

1.Click start -> programs -> Microsoft SQL Server 2005


->configuration tools ->reporting services configuration tool.
2.Connect to the report server.
3.Select e-mail settings.
4.Enter a sender address and the name of the SMTP server.
5.Click apply to accept the configuration. Any errors will be
noted. click exit to close the program.
Creating a data-driven subscription delivery
by e-mail

Creating the recipients data sore


1.Click start ->programs -> Microsoft SQL Server 2005-> Sql server
management studio.
2.Right click the database folder and select new database. Name it recipients
and click ok.
3.Navigate to the tables folder, right click, and select new table.
4.Add five columns:empname,address,employeeid,outputtype and linked. For
empname and address, set the datatype to varchar(50). For all other
columns, use the default data type of nchar(10).save the table as
recipientinfo.
5.Click new query on the management studio toolbar, and select database
engine query.
Creating a data-driven subscription delivery
by e-mail
6. Expand the list of available databases, and select recipients.
7. In the query window, use the following code to use insert into to add
four rows of data.
8. Insert into reciients.dbo.recipientinfo (empname, address, employeeid,
outputtype,linked) values (‘mike gunderloy’,’<your e-mail
address>’,’1’,’ image’,’true’)
Insert into reciients.dbo.recipientinfo (empname, address, employeeid,
outputtype,linked) values(‘joe jorden’,’<your e-mail address>’,’2’,’
mhtml’,’true’)
Insert into reciients.dbo.recipientinfo (empname, address, employeeid,
outputtype,linked) values(‘dave tschanz’,’<your e-mail
address>’,’3’,’pdf’,’true’)
Insert into reciients.dbo.recipientinfo (empname, address,
employeeid,outputtype,linked) values(‘tom cirtin’,’<your e-mail
address>’,’4’,’ execl’,’true’)
9. Click execute.
10. Confirm the table has four rows of data by using select *from
recipientinfo.
Creating a data-driven subscription with
report manager (e-mail delivery)
1.Open report manager and open the company sales report in the
adventureworks sample reports folder.
2.Click subscription. click new data-driven subscription to begin creating the
data-driven subscription.
3.Type data-driven subscription example.
4.Select report server e-mail in the “specify how recipients are notified” drop-
down box.
5.Under “specify a data source that contains recipient information, ”mark
“specify for this subscription only if it is not already marked. ”click next.
6.Confirm the connection type is set to Microsoft Sql server.
7.Type data source=localhost;initial catalog=recipients in the connection string
box.
Creating a data-driven subscription with
report manager (e-mail delivery)

8.Specify the user credentials for this report-in this case your domain
username and password. click “use as windows credentials when
connecting to the data source,” and then click next.
9.In the query pane type select *from recipients. click the validate button.
when the query is validated, click next to go to the specify delivery
extension setting for report server e-mail page.
10.In the to option, select “get the value from the database” and select address.
11.Accept the no value settings for the cc, bcc and replyto options.
12.Accept the no value for include report. you can opt to send the report and a
hyperlink (using the include link option), just the report ,just a link, or
neither.
13.Select “get the value from the database in the render format” option, and
select output type.
14.Accept the default values for priority, subject option, and comment option.
Creating a data-driven subscription with
report manager(e-mail delivery)

15.The include link option determines whether a link with the report URL is
sent. select “get the value from the database” and select linked.
16.Click next to open the “specify report parameter values” page.
17.Click next. select “on a schedule created for this subscription.”
18.Click next. In the schedule details section, click once and specify a time.
19.Click finish to generate the subscription and return to the reports
subscription page. From here you can open the subscription for editing as
well as delete it.
Creating a data-driven subscription with
management studio (file share delivery)
1.Open the report server in management studio and navigate to product line
sales report under home/adventureworks sample reports.
2.Expand the company sales tree.
3.Right click the subscription folder->select new data subscription from the
pop up menu to start the data driven subscription wizard. click next.
4.Type data driven subscription example2 in the description box. Accept
report server file share as the delivery method. click next.
5.On the delivery data source page, select “a custom data source
=localhost;initial catalog=recipients in the connection string box.
6.Select “credentials stored securely on the report server.” enter your domain
username and password. mark the “use as windows credentials when
connecting to the data source” check box. click next to open the delivery
query page.
Creating a data-driven subscription with
management studio(file share delivery)

7.In the command text window, type select * from recipientinfo. click the
validate button. when the query is validated, click next to go to the
specified delivery extension setting for report server e-mail page.
8.On the extension setting page, name the file: data driven subscription
example2.

9.In the file extension field accept the default value.


10.In the path field, specify the path to the file share using the UNC name.
11.In render format, select query results field from the setting source and
select output type for the setting value.
Creating a data-driven subscription with
management studio(file share delivery)
12.Enter your username with permissions to write to the file sharing.
13.Enter the password.
14.In the write mode field, select which option you want to be taken, either
override or auto increment, if a file with the same name is encountered
.click next.
15.Specify any relevant parameter values on this page. The company sales
report has no user provider parameters. click next.
16.Select on a custom schedule. in the type dropdown box select once. Specify
a start time and click ok. click finish.
Shared schedule

Creating a shared schedule with report manager:


1.Open report manager and click site settings.
2.Click the “manage shared schedules” link in the other section.
3.Click new schedules.
4.In the schedule name box type shared schedule example.
5.In schedule details you set the frequency days and time the items using this
report will run. set the schedule to run on a weekly basis on Mondays and
Wednesdays at 7am.
6.In the start and end date section you can specify the dates to start and end
the schedule. The default values are the date the report is created, with no
stop date. accept these values and click ok.
7.The shared schedule appears on the shared schedule page which is
accessible from site settings -> manage shared schedules. To modify a
schedule, click on the schedule do u want to change and delete a schedule
from this page
Creating shared schedule with management
studio

1.Open management studio and open a report server.


2.Right click the shared schedules folder. select new schedule
from the pop up menu to open the general page of the new
shared schedules properties box.
3.Type shared schedule example2 in the name textbox. choose
what ever you like. for the frequency and time to run the
schedule on.
4.Click ok. The new shared schedule appears. To modify an
existing shared schedule, right click schedule modify and then
click properties. To delete the schedule right click on it and
select delete.
Jobs

Opening the manage jobs with report manager


1.Open report manager and click site settings.
2.Click the manage jobs links. In the other section.
3.The manager manage jobs page opens and displays any jobs
that are actually executing on the server. If no jobs are being
run, the page is empty.
Managing jobs with management studio

1.Open management studio and open a report server.

2.Click the jobs folder, jobs only appear if they are being run.
Printing reports

1.Open report manager and navigate to the product line sales


report, and open it.
2.On the toolbar click the print icons. The first time you print an
html report, the report server will attempt to install an activeX
control that is required for printing. click yes.
3.In the print dialogue box, select a print device click ok.
Exporting a report

Natively supported export formats include


1.CSV
2.Excel
3.Mhtml
4.PDF
5.Tiff
6.Xml
i) Open a report manager and navigate to the product line sales report and
open it.
ii) on the toolbar select acrobat (Pdf file) in the select “select the format”
dropdown list.
iii) click export. The report opens in the target application
Printing a report to another application

1.Open report manager and navigate to the product line sales


report, then open it.
2.On the toolbar select Tiff file and click export. I9n the file
download dialog, select open, the report opens in Tiff format
inside the default viewer.
3.Select file ->print, or click the print icon to send the report to a
print in a new format.

You might also like