Professional Documents
Culture Documents
SQL Server Reporting Services (SSRS)
SQL Server Reporting Services (SSRS)
(SSRS)
SQL Server 2005
REPORTING SERVICES
The ability to extract and present information from a database in any no. of
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
•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
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.
2.Click the jobs folder, jobs only appear if they are being run.
Printing reports