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

A Report server administration creates a report that is automatically delivered to a destination when an event triggers it. Browser. Report Manager.g. .REPORT DELIVERY ‡ RS provides two basic methods of accessing an delivering reports ‡ On demand access means that users utilizes a report viewing tool(e. Share point web part) ‡ Subscription based access.

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. .Key terms: Report Definition: It contains information about the query format and other design elements needed to run the Report.

Report snapshot: This type of reports contains data captured at a single moment in time. .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 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 .

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 SERVER ‡ A report server is the main processing component of Reporting Services.

. Report manager is also used report viewing and navigation. Report Manager can be used to a administer a report server remotely through HTTP. subscribing to reports and a number of management and administrative tasks. Key tasks performed with report manger include browsing report server folder viewing reports and their properties.REPORT MANAGER ‡ This is web-based access and management tool that runs in internet Explorer.

Report designer allows you to create tabular. And first two can be created using Report Wizard. Report designer was intended for use by IT professionals and application programmers.matrix. .REPORT DESIGNER ‡ Report designer is based in Visual studio and accessed through BIDS. or freeform reports.

.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.) .

Confirm that Business Intelligence projects is selected in the left pane and Report server Project wizard is selected in the right pane. 5.3. 4. that is set to SQL Server. Select the New data source Radio button. click edit button to open the connection properties Dialog. accept the default location and solution name. The Report Wizard will start Automatically.In the Name text box type Report Wizard Example. .Click Next to go to the select Data Source Dialog Box. and Click OK.

in the ³Select or Enter Data Base name´ select the Adventure works DW database. type Local host/ use drop down list to select a server .In Server Name text box. 7. .Logon to the server . 8.6.confirm the use windows authentication radio button is selected.Connect->Database. you can use the test connection button to confirm you are connected to both the server and the database.

To return to select->Data source Dialog Box.LastName. Confirm that local server and adventure-works DW database are listed in the connection string->Next.In Design the Query dialog box->Query Builder to Design a Query. USE Adventureworks DW SELECT FirstName. DepartmentName. 10.Click OK.SickLeaveH ours FROM DimEmployee .9.VacationHours.

12. VacationHours. Lastname.Click Next->Open->Report Dialog Box. group and details used for specifying fields to be added.11. confirm that the radio button Next to Tabular is selected and click next.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. . SickLeaveHours fields into the details box.click next. Highlight the departmentName field and either click the group button or drag into group box. You can change the order of fields by highlighting them and dragging in the list.4th button to remove the fields. Add the Firstname.Rearrange the details display in the field list so that last name appears first.

Review the contents of the report summary to confirm entries are correct. 15. select corporate. A variety of options . 14. click next.13.Choose the table layout dialog box.Choose the table style dialog window.On completing the wizard page. mark the preview report check box and press finish.Choose deployment location dialog window . click next. Including whether to allow drill down and to improve sub totals. Click next. . name the report available Employee vacation and sicktime by department. Accept default location for the report server and deployment folder on the server . 16.

. note also that the report has been added to the reports folder under reportwizardexample in solution explorer.17.After a few moments the report is processed and a preview displayed in BIDS.

2. when done. the report layout should appear .Suppose you decide that you would like the available vacation hours report to sort employees by last name as well as group by department.Modify a report layout is also relatively simple.Click on title and change it from available Employees vacation and sick time by dept to employee vacation and sick time. 3. select the layout tab and then the body section of report.Modifying a Report 1. .

You can also use the individual property sheets to adjust and modify individual fields and report components.4. weight. color. decoration . these properties includes:  Display name  Associated tool tips  Navigational elements  Font type. size.

 Sorting  Actions  Placement on page  Alignment  Back ground and foreground colors .

Report Wizard cannot be used to create freeform reports.CREATE A REPORT USING REPORT DESIGN Although Report Wizard will probably be able to address most of your needs. 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 . it has limitation. In those cases you will need to create reports using designers. For examples.

In the Add New Item dialog box. Confirm the business intelligence project is selected in the left pane and Report Server Project is selected in the right plane. 5. right-click Report Project Example and select Add > New Item from the pop-up menu. 6. 2.CREATE A SIMPLE FREEFORM REPORT USING REPORT DESIGNER 1. type Report Project Examples.K In the solution explorer. 4. From the file menu select New > Project to open the new project dialog box. Lunch BIDS from start > Program > Microsoft SQL Server 2005. and click O. select report. accept the default location and solution Name. . In the name text box. 3.

. Then. click the edit Button 10. Add 8.rdl ands click.> to open the data Source dialog Box..In Server Name text box type localhost or use the drop down button to select a server. In order to create a report there needs to be associated data.Under ³Log On To The Server´. confirm the user window Authentication radio button is selected. first make sure that the data tab is selected 9. Accept the default name and ensure that Microsoft SQL Server is listed under type.7. Select< New Dataset. 11.In the Name text box.In the dataset drop down list . enter Report Project Example. At the top of the Report Designer Window. We will associate the AdventureWorkDW database with the report.

13. You Can use the test connection button to confirm you are connected to both the server and the database.12.´ box select the AdventureWorkDW Database.lastname.sickleaveho urs from DimEmployee .vacationhours. 14. Use AdventureWorkDW Select firstname.Click OK to return to the select the Data Souse Dialog Box.Under ³Connect to a database ³ in the ³selected or enter a database name.In this case we¶ll use the same query as ewe did with the report Builder examples above.Now you¶ll create a simple query for the data set .departmentname. Click Next to return to Report Designer. Confirm that the local server and AdventureWorkDW database are listed in the connection string.

16. If not you can open it by selecting View > Database or pressing the Ctrl-Alt-D Keys. In the Toolbox window .In the examples you¶ll create a simple list report showing the total number of vacation and sick leave hours per department. Now you¶re read to create the report layout.15. click the layout tab to show the blank report grid in the layout . Also ensure that the database view is active so that you can access the fields . In the view pane. 17. 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.select the list item and double click it. . expand the controls so it is the same width as the grid and about eight grid points high.Open the text window by clicking on the tools icons on the menu or selecting of view > toolbox. Then.

21. 22. 20. Right click inside the list box.Value and Ascending direction to sort the department names alphabetically.18. Select properties from the pop-up menu. In the Dataset Window select Vacation Hours and then the sickleaveHours and drag them to the right of the departmentNameBox. Select the departmentanme fields from the dataset tab and place it on the left side of the layout. . 23. in the Expression list. Expand font and set FontWeight to bold.Value so that the values are summarized by department. select =Fields! Departmentname. Click OK twice to return to the Report Layout Window. select the general tab and click the Edit details group button. In the list properties dialogs box. Under the sorting tab. select=Fields! Departmentname. In the details Grouping windows . To change the appearance of the font and basic setting in the DepartmentName textbox select the text box and click on the properties icon. 19.

Adding the various design elements is not difficult but a full review of all these feature is the scope the scope of this boo. As you can see. but not all. 24.Creating and using these elements depends on your need and how they are reflected in the individual report design. the result should look like those display in the graph.Before proceeding further. select file > Save all from the menu. Click on the Preview Tab. design properties by selecting the controls. .You can also change many. and selecting properties from the pop-upmenu. such as column heading and so forth. the report is lcking many of feature you might expect. 25. right clicking.

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. You can use parameters to add sorting to a report. to pass vales to a filter. or as variable for calculating data within the report. .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.

4.Click Add.Flooat and string data.Next. 2. When a user run a report the text in the fields appear next to the parameters text box. you can use the drop-down box to choose from Boolean . Type Text Next To Parameter text box in the prompt box. 3.From the menu bar.In the data type box.Integer. Select report ->Report Parameter . . Leave the string setting. Datetime.To add a parameter to the ReportProjectExample report 1. In the name box .type Parameterexample1.

The label property contains the text display to the users. it would provide a dynamic list from a query.vales fields. Create three labels. Examples 2 and Examples 3 and assign them vales of 1. Note: If from query Is selected .Allow the parameter to contain a blank value by selecting Allow Blank value. The data set used for this option is normally specifically created for the particular report parameters.3. . Examples 1.5. select Non-queried. If you had selected from Query. while values is the values passed on to the report server for the parameter. 6.2.then text boxes for the dataset . and label fields are shows instead. This allow you to provide a static list of values from which the users can choose a value. In Available Value.

Select None. ‡ Non ± queried to provide a static default vales.In the Default vale section .you can select. . ‡ 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. Press OK.7.

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

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

scheduling.Open the report server in management studio and navigate to product line sales report under home/adventureworks sample report.Navigate through the general.Expand the product line sales tree. 4.Right-click the subscription folder and select new subscription from the pop-up menu. .click ok.Using Management Studio 1.and parameters pages and specify the various setting as you would in report manager. 3. 2.

4.Click start -> programs -> Microsoft SQL Server 2005 >configuration tools ->reporting services configuration tool.Enter a sender address and the name of the SMTP server.Connect to the report server.Click apply to accept the configuration.Configuring report server for e-mail delivery 1. 2. Any errors will be noted. click exit to close the program. 5. .Select e-mail settings. 3.

outputtype and linked.Add five columns:empname.save the table as recipientinfo.Click new query on the management studio toolbar. and select database engine query. .Click start ->programs -> Microsoft SQL Server 2005-> Sql server management studio. right click. and select new table. For all other columns. 3.employeeid. For empname and address. 5.Creating a data-driven subscription delivery by e-mail Creating the recipients data sore 1. Name it recipients and click ok. 2.Right click the database folder and select new database.address. use the default data type of nchar(10). set the datatype to varchar(50).Navigate to the tables folder. 4.

address. employeeid.recipientinfo (empname.dbo. address. Insert into reciients.linked) values(µtom cirtin¶.¶2¶.recipientinfo (empname. employeeid.¶true¶) Insert into reciients. employeeid. address.¶<your e-mail address>¶.linked) values(µdave tschanz¶.recipientinfo (empname.linked) values (µmike gunderloy¶.Creating a data-driven subscription delivery by e-mail Expand the list of available databases.¶ mhtml¶.outputtype.dbo.¶true¶) 9.¶true¶) Insert into reciients.¶true¶) Insert into reciients. outputtype. use the following code to use insert into to add four rows of data. and select recipients.dbo. 8. 10.¶3¶.¶ execl¶.¶<your e-mail address>¶.¶ image¶. outputtype. Confirm the table has four rows of data by using select *from recipientinfo. outputtype.¶4¶.¶pdf¶.linked) values(µjoe jorden¶.dbo.¶1¶. In the query window. 6.recipientinfo (empname. 7.¶<your e-mail address>¶. Click execute. .¶<your e-mail address>¶. employeeid. address.

Select report server e-mail in the ³specify how recipients are notified´ dropdown box. 4. 7. ´mark ³specify for this subscription only if it is not already marked. . 5. 3.Creating a data-driven subscription with report manager (e-mail delivery) 1.Click subscription.Confirm the connection type is set to Microsoft Sql server. click new data-driven subscription to begin creating the data-driven subscription.initial catalog=recipients in the connection string box. 6. ´click next.Open report manager and open the company sales report in the adventureworks sample reports folder.Type data source=localhost.Under ³specify a data source that contains recipient information.Type data-driven subscription example. 2.

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

The include link option determines whether a link with the report URL is sent. 17.Click next to open the ³specify report parameter values´ page. 19. .Click finish to generate the subscription and return to the reports subscription page. In the schedule details section. click once and specify a time.´ 18.Click next. select ³on a schedule created for this subscription. select ³get the value from the database´ and select linked.Creating a data-driven subscription with report manager(e-mail delivery) 15.Click next. 16. From here you can open the subscription for editing as well as delete it.

´ enter your domain username and password.Type data driven subscription example2 in the description box. click next. select ³a custom data source =localhost. 2.Right click the subscription folder->select new data subscription from the pop up menu to start the data driven subscription wizard.Open the report server in management studio and navigate to product line sales report under home/adventureworks sample reports.Select ³credentials stored securely on the report server.Expand the company sales tree.On the delivery data source page. 3. click next. mark the ³use as windows credentials when connecting to the data source´ check box. 4.initial catalog=recipients in the connection string box. . Accept report server file share as the delivery method. 5. click next to open the delivery query page. 6.Creating a data-driven subscription with management studio (file share delivery) 1.

specify the path to the file share using the UNC name. click the validate button.On the extension setting page. name the file: data driven subscription example2. select query results field from the setting source and select output type for the setting value. 8. .In the command text window. when the query is validated. 10. 9. type select * from recipientinfo. 11.In the path field.In render format.In the file extension field accept the default value.Creating a data-driven subscription with management studio(file share delivery) 7. click next to go to the specified delivery extension setting for report server e-mail page.

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

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

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

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

Click the jobs folder.Managing jobs with management studio 1. . 2.Open management studio and open a report server. jobs only appear if they are being run.

. click yes.Printing reports 1.In the print dialogue box. the report server will attempt to install an activeX control that is required for printing.On the toolbar click the print icons. select a print device click ok. 2.Open report manager and navigate to the product line sales report. 3. The first time you print an html report. and open it.

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

the report opens in Tiff format inside the default viewer. or click the print icon to send the report to a print in a new format. 2.Open report manager and navigate to the product line sales report.Printing a report to another application 1. 3. then open it. . I9n the file download dialog.On the toolbar select Tiff file and click export.Select file ->print. select open.

Sign up to vote on this title
UsefulNot useful