Beruflich Dokumente
Kultur Dokumente
(SSRS)
properly using, calibrating, operating, monitoring and maintaining all Products consistent with all Rockwell Automation
or third-party provided instructions, warnings, recommendations and documentation;
ensuring that only properly trained personnel use, operate and maintain the Products at all times;
staying informed of all Product updates and alerts and implementing all updates and fixes; and
all other factors affecting the Products that are outside of the direct control of Rockwell Automation.
Reproduction of the contents of the Documentation, in whole or in part, without written permission of Rockwell Automation is
prohibited.
Throughout this manual we use the following notes to make you aware of safety considerations:
Identifies information about practices or circumstances
that can cause an explosion in a hazardous environment,
which may lead to personal injury or death, property damage, or economic loss.
Identifies information that is critical for successful application and understanding of the product.
Identifies information about practices or circumstances that can lead to personal injury or death, property
damage, or economic loss. Attentions help you:
identify a hazard
avoid a hazard
recognize the consequence
Labels may be located on or inside the drive to alert people that dangerous voltage may be present.
Labels may be located on or inside the drive to alert people that surfaces may be dangerous temperatures.
Contents
Before you begin ........................................................................................................................................... 4
Tools & prerequisites ........................................................................................................................................................................ 4
Lab Image Information ...................................................................................................................................................................... 4
Overview ....................................................................................................................................................... 5
Introduction to Report Manager .................................................................................................................... 6
Connecting to Report Manager ......................................................................................................................................................... 6
Exploring Reporting Content ............................................................................................................................................................. 7
Tables............................................................................................................................................................ 9
Creating a Shared Data Source ........................................................................................................................................................ 9
Creating a Shared Dataset ............................................................................................................................................................. 12
Creating a Table Report.................................................................................................................................................................. 16
Adding Row Grouping and Summary Information .......................................................................................................................... 32
Report Parameters ...................................................................................................................................... 42
Creating Report Parameters ........................................................................................................................................................... 42
Automatically Populating Parameters ............................................................................................................................................. 49
Selecting Multiple Parameters ........................................................................................................................................................ 52
Cascading Parameters ................................................................................................................................................................... 55
Charts .......................................................................................................................................................... 57
Adding a Pie Chart .......................................................................................................................................................................... 57
Adding Sparklines and Data Bars ................................................................................................................................................... 63
Drillthrough Reports .................................................................................................................................... 67
Security ....................................................................................................................................................... 75
3 of 83
Files required:
Username: Labuser
Password: rockwell
The VMWare image for this lab contains multiple Rockwell Software products and may take several minutes to load. A dialog
box similar to the one shown below will launch when the Operating System is ready. When the dialog box automatically closes
the lab VMWare image should be ready to use, although several more minutes may be required based on the performance of the
host system.
The lab image contains a script that automatically generates data for the last 10 days. If this lab is not completed within several
hours after the image boots, some reports may appear to not function due to the fact that the data is outside of the reporting time
range. Rebooting the image will cause the reporting data to update to the current time.
There are several sections of this lab which requires users to enter text. There is a document named Lab
Text.docx in the Lab Files folder (on the image desktop) which contains all of the lab text. Lab users may
find it useful to open the document when starting the lab and copying/pasting the text from the word
document rather than typing in the information.
Users may be prompted for credentials while in Report Manager during this lab. This occurs when
the user has not performed an action on the server for several minutes and the users credentials
time out. Users can select Cancel to automatically be logged in with their Windows credentials to
continue the lab exercises.
4 of 83
Overview
Reporting Services is a server-based reporting platform that provides comprehensive reporting functionality for a variety of data
sources. SQL Server Reporting Services provides a full range of ready-to-use tools and services to help you create, deploy, and
manage reports for your organization, as well as programming features that enable you to extend and customize your reporting
functionality. Reporting Services tools work within the Microsoft Visual Studio environment and are fully integrated with SQL
Server tools and components.
With Reporting Services, you can create interactive, tabular, graphical, or free-form reports from relational, multidimensional, or
XML-based data sources. Reports can include rich data visualization, including charts, maps, and sparklines. You can publish
reports, schedule report processing, or access reports on-demand. You can select from a variety of viewing formats, export
reports to other applications such as Microsoft Excel, and subscribe to published reports. The reports that you create can be
viewed over a Web-based connection or as part of a Microsoft Windows application or SharePoint site. You can also create data
alerts on reports published to a SharePoint site and receive email messages when report data changes.
This Hands-on lab provides an opportunity to learn how to use SQL Server Reporting Services (SSRS) by walking users through
the basic foundation blocks of Reporting Services including connecting to Report Manager, using Report Builder to create reports
and charts, and understanding security.
5 of 83
Create, secure, and maintain the folder hierarchy to organize items on the server.
Create report models that connect to and retrieve data from a Microsoft SQL Server Analysis Services data source or
from a SQL Server relational data source.
Set model item security to allow access to specific entities in the model, or map entities to predefined click through
reports that you create in advance.
Create shared schedules and shared data sources to make schedules and data source connections more
manageable.
Create data-driven subscriptions that roll out reports to a large recipient list.
Create linked reports to reuse and repurpose an existing report in different ways.
Launch Report Builder to create reports that you can save and run on the report server.
You can use Report Manager to browse the report server folders or search for specific reports. You can view a report, its general
properties, and paste copies of the report that are captured in report history. Depending on your permissions, you might also be
able to subscribe to reports for delivery to an e-mail inbox or a shared folder on the file system. Note that some Report Manager
features are only available in specified editions of SQL Server.
6 of 83
The following table describes the icons that are used in Report Manager
1. The FTEnergy folder contains reports for FactoryTalk EnergyMetrix. FactoryTalk EnergyMetrix is a
sophisticated Web-enabled, energy management software package that gives you access to critical energy
information from virtually any location. Select the FTEnergy folder.
2. You will see that there are several folders containing Data Sources and Datasets for the two available
Factorytalk EnergyMetrix reports. We will be discussing and creating Data Sources and Datasets in later
lab exercises. Select MeterReport. (There may be a delay loading the report the first time the data source
is accessed after the image is started)
7 of 83
The meter report brings together various reporting objects such as tables, charts and scales to create a
single comprehensive report based on a common data set. Some of these items will be used to create a
report in this lab.
3. At the top of the report there is a drop down selection for Meter. This report has been created with Meter as
a parameter to allow users to view this report for any meter in their system. Select the Line 2 Labeler
meter (the last item in the list) and then select View Report.
4. Select Home in the Report Manager header to return to the Report Manager home page (or use the
browser back button).
8 of 83
Tables
A table can be used to display detail data or grouped data, or a combination of both. You can group data by a single field, by
multiple fields, or by writing your own expression. You can create nested groups or independent, adjacent groups. To display
aggregated values for grouped data you can add totals to groups. Rows and columns can be formatted to highlight the data you
want to emphasize. You can initially hide detail or grouped data and include drilldown toggles to enable a user to interactively
choose how much data to show.
In this exercise we will be using a demonstration database built into the lab image that simulates a Steam Assisted Gravity
Drainage (SAGD) system. SAGD is an enhanced oil recovery technology for producing heavy crude oil and bitumen. It is an
advanced form of steam stimulation in which a pair of horizontal wells are drilled into the oil reservoir, one a few meters above
the other. High pressure steam is continuously injected into the upper wellbore to heat the oil and reduce its viscosity, causing
the oil to drain into the lower wellbore, where it is pumped out. We will be using the table object to create a downtime cost report
for the oil wells.
1. The first task is to create a folder structure to hold the reporting content for this lab. In the Report Manager
home page, select New Folder.
9 of 83
10 of 83
Credentials are required to run queries, to preview the report locally, and to preview the report from the
report server. After you publish your report, you may need to change the credentials for the data source so
that when the report runs on the report server the permissions to retrieve the data are valid. Additional
security information will be discussed later in this lab.
12. Select the Test Connection button. After receiving a Connection created successfully message, select OK.
11 of 83
Shared dataset: A shared dataset is defined on the report server. You can browse to the server to create a shared
dataset or to select a predefined one to add to your report.
Embedded dataset: An embedded dataset is defined in and used by only the report it is embedded in.
In this exercise we are going to create a shared dataset that will be used for all reporting content
2. We will create a folder to contain our shared datasets. Note that a dataset can be created at any level in
Reporting Services. As a best practice we will keep the shared datasets separate from reports. Select New
Folder.
12 of 83
Microsoft SQL Server Reporting Services Report Builder is a report authoring tool that features a Microsoft
Office-like authoring environment. When you design a report, you specify where to get the data, which data
to get, and how to display the data. When you run the report, the report processor takes all the information
you have specified, retrieves the data, and combines it with the report layout to generate the report. You can
preview your reports in Report Builder, or you can publish your report to a report server, or a report server in
SharePoint integrated mode, where others can run it.
6. Select New Dataset.
7. Youll see that Report Manager lists a shared dataset that has been used previously to create sample
content. We want to use the dataset that we just created instead. Select Browse other data sources
8. Browse to Lab Reporting > Data Sources. Select the LabReporting_RACEDEMO data source and click
Open.
9. Make sure LabReporting_RACEDEMO is selected and click Create.
13 of 83
10. Expand the Tables folder to see the list of tables available in the RACEDemo database. Select the
checkbox next to the demoSAGProductionLoss table.
Each dataset in a report contains a collection of fields. Typically, the fields refer to columns or fields returned
by the query in the dataset. For an XML data source, the fields refer to values from XML element nodes and
their attributes. Fields that refer to database fields contain a pointer to the database field and a name
property. You can use the name property to provide a friendly name in place of the name of the database
field. In addition to database fields, the fields list can contain calculated fields. Calculated fields contain a
name and an expression. The expression can be as simple as a concatenation of two database fields (for
example, first name and last name), or it can be used to perform complex calculations.
11. Select Run Query to see the returned dataset.
14 of 83
12. We now have a simple data set that returns all data in the production loss table. Some advanced options
like adding calculated tags for the dataset will be performed in later labs. Select the Save icon.
13. Browse to Lab Reporting > DataSets. Name the dataset ProductionLoss and select OK.
14. Exit Report Builder by selecting the Report Builder icon > Exit Report Builder.
15 of 83
15. Refresh the browser to see the ProductionLoss dataset under Lab Reporting > Datasets.
16 of 83
4. The first task we need to perform is to connect to the dataset that we just created. Right-click on Datasets
and select Add Dataset.
Note that we were not asked to choose a data source for the report. This is because the ProductionLoss
shared dataset that we created in the previous lab section already has the connection defined to our shared
data source. Had we not created the shared data source and dataset, we could have created them inside
this report. The data source and dataset would then only have been accessible within this report.
17 of 83
8. Select Fields.
Report Builder has test run the query and automatically generated a list of fields from the query results when
we created the shared dataset.
9. Select OK.
10. Report Manager has already added a place for the report title (a text box) and a report footer containing a
field with the time that the report was generated. We will be editing the report layout later in this exercise.
Expand the report so that it is wider to accommodate the number of columns from our ProductionLoss
dataset. The report length will automatically expand to accommodate the number of rows in the table.
18 of 83
11. Right-click on the report and select Insert > Table. Move the table to the upper left corner under the title.
If an object inside the table is selected, to move the table you need to select the entire object. To do this,
click on the square at the upper-left side of the table.
12. Select the cell located in the first column, second row of the grid. Click on the small table icon in the
upper-left corner of the cell to see the list of available fields from the ProductionLoss dataset.
Note that the Title Field is automatically applied to the header for the column. The column name can be
changed by clicking on it and typing in a new name.
19 of 83
14. Follow the same procedure to add the remaining fields from the ProductionLoss dataset to the table. You
will need to manually add new columns to the table for the additional fields. To add new columns, right-click
on the furthest right column and select Insert Column > Right.
15. We can immediately preview the data in our table. Select Run from the menu to see a preview of the
report.
16. The result is a raw grid of data. Before we spend time formatting the report, wed like to add information for
the number of barrels lost and total downtime cost to our report. These values can be calculated based on
the information already in our dataset so we will add calculated fields to our dataset. Select Design to
return to the report editor.
20 of 83
17. Right-click on the ProductionLoss dataset and select Add Calculated Field.
18. Name the new field Barrels and then select the fx button to modify the calculated expression for the field.
The Expression dialog box is used to write Microsoft Visual Basic expressions for report item properties.
You can use expressions to set many properties, including color, font, and borders. At run time, the report
processor evaluates expressions and substitutes the result for the value of the property.
The Expression dialog box includes a code window, category tree, category items, description pane, and
example pane. The Expression dialog box is context-sensitive; the category items and descriptions change
in response to the expression category you are working with.
19. To get the total number of barrels, we need to multiply the volume in the table by a constant. Select Fields
(ProductionLoss). Double-click on VolumeM3 to add the value to the expression.
21 of 83
20. After the field expression, add the text *8.3864 and select OK.
22 of 83
27. Add the Barrels field to the new column. Note that you may receive an error the first time you attempt to
add the Barrels column to the table. This is due to the fact that the table may not have refreshed its
connection to the dataset. If you receive the error, select OK, right-click on the ProductionLoss dataset and
select Dataset Properties. Close the dataset properties and then try to add the Barrels column again.
28. Follow the same procedure to add the DowntimeCost field to the right of the Oil Cost column.
29. Select Run to preview the calculated results for Barrels and Downtime Cost. Select Design to return to the
report editor when finished.
Note that the addition of the Barrels and Downtime Cost was made to the report dataset reference and not
the dataset itself. If we had thought we would be using the calculated fields in other reports we would have
needed to edit the original shared dataset we created.
30. You may have noticed that the calculated results show a large number of decimal places. We can adjust
how these are displayed in the report. Right-click on the Barrels field cell and select Text Box Properties.
23 of 83
32. Change the category to Number. The default setting for a number type is two decimal places. That will
work for our report so select OK.
33. Follow the same steps to change the format for the DowntimeCost field to Currency (Select Number and
then Currency for the category).
34. Follow the same steps to change the format for the OilCost field to Currency.
35. Run the report.
Notice that while we can now see that the Downtime Cost column is in currency format, the Oil Cost column
did not auto format. This is due to the fact that the Oil Cost column is a text data type in the SQL database
rather than numeric. We can configure the OilCost field to convert to a numeric data type in our table.
36. Return to Design mode.
37. Right-click on the OilCost field and select Text Box Properties.
38. Select the fx button next to the Value field.
39. Change the expression to the following:
=Val(Fields!OilCost.Value)
This will convert the OilCost field to a numeric value.
24 of 83
25 of 83
49. Change the Duration Sec column heading to Duration hh:mm:ss (with an Enter after Duration so that
hh:mm:ss is on the second line). Expand the height of the header row so that the full column names are
visible.
50. Highlight the entire header row and select Bold for the font.
51. Select the first two rows in the table and select center for the justification.
52. The next item we want to configure is the report header. Information in the report header will be repeated
on every report page in the case that our report spans multiple pages. Right-click on the report and select
Insert > Page Header.
Drag the text box containing the Title to the report header so that it is displayed on every page of the report.
26 of 83
53. We could type in a static report name, but lets add the report title field instead. This way if someone
decides to rename the report they dont need to modify the report itself. Click in the title area (where it says
Click to add title). Right-click in the title area and select Create Placeholder.
27 of 83
58. Weve adjusted simple properties, but many additional properties of SSRS reports can be adjusted by
directly editing the object properties. Additionally, many properties can be controlled using complex
expressions. To see a list of available properties, select View from the Report Builder menu.
59. Select the Properties checkbox. This will display the Properties panel on the right side of the Report
Builder editor.
60. Highlight the header row in the table.
61. In the Properties panel, select the dropdown next to BackgroundColor (under Fill) and select Light Steel
Blue.
28 of 83
63. In the Properties panel, select the dropdown next to BackgroundColor (under Fill) and select Expression.
29 of 83
66. The last modification we will make is to change the way the reporting data is sorted. Below the report
editing area, under Row Groups select the drop down next to the (Details) Row Group. Select Group
Properties.
30 of 83
74. Run the report to ensure that there are no errors (you will need to reselect the Home tab to see the Run
option).
75. Close Report Builder.
76. Refresh the Home > Lab Reporting view to see the newly created report.
77. View the completed report by selecting the Downtime Cost Report.
31 of 83
Note that the report likely spans multiple pages. Pages can be reached by using the page navigation
buttons at the top of the report.
3. Under Row Groups (beneath the reporting area), select the dropdown next to the Details group and select
Add Group > Parent Group.
32 of 83
4. Select Field for Group by and the checkbox for Add group header. The group header is where we will
place the summary information for the group. Select OK.
You will see that an additional Field column has been added as the left most column in the table for the
grouping we just added.
5. Under Row Groups, select the dropdown next to the Details group again and select Add Group > Parent
Group.
6. Select WellPad for Group by and the checkbox for Add group header. Select OK.
7. Follow the same procedure to add a grouping for WellPair as a parent group for Details.
33 of 83
8. We dont want an additional copy of our grouped columns to show up in the report, so delete the second set
of columns by highlighting them, right-clicking and selecting Delete Columns.
Running the report will show that the data has now been grouped by Field, Well Pad, and Well Pair.
9. Next we will make our groupings expandable. Select the dropdown next to Details under Row Groups and
select Group Properties.
34 of 83
15. Select the dropdown next to the WellPair group and select Group Properties.
16. In Visibility, set Hide when the report is initially run and configure the group to toggle based on WellPad1.
35 of 83
17. Configure the Group Properties of the WellPad group to Show when the report is initially run and toggle
based on Field1.
36 of 83
Report Builder will automatically summarize the columns that its capable of summarizing.
21. Following the same procedure, add totals before the WellPair and WellPad groups.
22. Select all of the summary columns by clicking on the cell under the Duration column heading and dragging
to the cell above the DowntimeCost field. Change the cell formatting to red and bold.
23. Delete the Total text above the WellPad and WellPair fields. When finished your report should look like the
following screenshot:
You may have noticed that the summary information was not added for the Duration column. This is due to
the fact that we added a custom value for that column. We will add custom summary values in the next
steps.
37 of 83
24. Right-click on the WellPair group cell for Duration Sec and select Text Box Properties.
38 of 83
30. Oil Cost was not automatically totalized even though it appears to be a number. As previously discussed,
Oil Cost is a text column in the database. In order to perform a calculation at the group level on the Oil Cost
we will need to convert the OilCost field to a value as we did in the previous exercise. Also, it would make
more sense to display the Oil Cost average rather than a total. Right-click on the Well Pair group cell for Oil
Cost and select Text Box Properties.
39 of 83
40 of 83
44. Follow the same procedure in steps 30-43 to add the Average values for the Field and WellPad groups
(The expression will be the same for all three groups just as it was for the Duration summary equation)
41 of 83
Report Parameters
We now have a report that displays downtime data. However, we are currently returning all data that has ever been logged to
the SQL table. A more realistic and efficient report would return a subset of that data using parameters. In Report Builder, report
parameters are a built-in feature that you can use to control report data, connect related reports together, and vary report
presentation. The following exercises will walk you through adding simple parameters to the report and modifying the parameter
set to utilize more advanced parameter features.
1. We need to edit the original dataset to accept the parameter values. Navigate to Home > Lab Reporting >
Datasets.
2. Select the drop down next to the ProductionLoss dataset and select Edit in Report Builder.
42 of 83
This is the SQL query that was built for us when we chose the demoSAGDProdcutionLoss table in a
previous exercise.
4. We are going to add filter criteria to the SQL query. Add the following code to the end of the query:
WHERE
demoSAGDProductionLoss.StartTime >= @StartTime
AND
demoSAGDProductionLoss.EndTime <= @EndTime
AND
demoSAGDProductionLoss.DowntimeCode LIKE '%' + @DowntimeCode + '%'
43 of 83
7. Enter the following values for the parameters and select OK:
a. @StartTime: Yesterdays date. For example 6/10/2013
b. @EndTime: Todays date. For example 6/11/2013
c. @DowntimeCode: Pump
The results set will be filtered for the parameters entered:
44 of 83
11. Under Datasets, right-click on the ProductionLoss dataset and select Dataset Properties.
12. Select the Refresh Fields button to refresh the changes weve made to the ProductionLoss dataset
reference. Note that this will not affect the calculated fields we added to the dataset in the previous
exercise.
13. Select the Parameters tab. You will see that the parameters we created in the last couple of steps have
been imported. We have the option to tie these parameters to a defined report parameter or an expression.
Select OK to close the dataset properties dialog.
45 of 83
14. The parameters for the report were automatically created when we selected OK. Expand the Parameters
folder.
If we re-opened the ProductionLoss dataset properties the Parameters section would show that the
Parameters for the dataset were mapped to the newly created report parameters.
15. Next we are going to configure our parameters. Right-click on the StartTime parameter and select
Parameter Properties.
46 of 83
19. Add the expression =dateadd(h,-12,Now()). Every time the report is ran the start time will
default to 12 hours ago and then allow users to change the time period.
20. Select OK to close the expression editor and then OK to close the StartTime parameter properties.
21. Right-click on the EndTime parameter and select Parameter Properties.
22. Change the Data type to Date/Time.
23. Select Default Values and choose the option Specify Values.
24. Select Add and then select the fx button to edit the default value.
25. Enter the expression =now(). This will set the report end time to the timestamp when the report is ran.
Select OK to close the expression editor and then OK to close the EndTime parameter properties.
47 of 83
30. Delete (Null) from value and leave the Value field blank. Since blank parameters will work with our query,
this configuration will cause the report to automatically generate at runtime with a blank value (effectively
returning all Downtime codes). Select OK to close the parameter properties.
33. Select View Report. Depending on the dataset generated, there might not be any records for the Replace
Part downtime code in your dataset. If the report comes up blank, try setting the Start time back an extra
day or choosing a different downtime code.
Note that you did not have to enter the entire Downtime Code string. This is due to the way we wrote the
SQL query (the LIKE expression with the % symbols surrounding it will allow users to enter any part of the
parameter name).
34. Return to Design mode.
35. Save the report.
48 of 83
1. We need to create a new dataset for our parameter. We are going to create a dataset in this report since
we dont think it will need to be reused. First we need to define what data source the new dataset will use.
Right-click on Data Sources and select Add Data Source.
2. Select the shared data source LabReporting_RACEDEMO. Name the data source reference
LabReporting_RACEDEMO and select OK.
3. Next we will create a dataset for the Downtime code parameter. Right-click on Datasets and select Add
Dataset.
49 of 83
4. Name the dataset DowntimeCode and select Use a dataset embedded in my report.
5. Select the LabReporting_RACEDEMO dataset reference (which we just created)
6. Enter the following SQL query:
Select Distinct demoSAGDProductionLoss.DowntimeCode
FROM
demoSAGDProductionLoss
ORDER BY
demoSAGDProductionLoss.DowntimeCode
When finished your data source configuration should look like the following screenshot:
7. Select the Refresh Fields button. If the query has been entered correctly there should be no error messages.
Select Fields to see that the query successfully determined the available fields.
50 of 83
51 of 83
The report has been filtered to only show the selected Downtime Code. As before, the selected downtime
code may not have data depending on your dataset. To see data either adjust the time period or Select
another Downtime Code from the list and then the View Report button to see the filtered report.
18. Return to Design mode and Save the report.
19. Close Report Builder.
Selecting Multiple Parameters
You may have noticed that when we added the Downtime Code parameters in the previous section we limited the report to only
show data for a single parameter at a time. It may be more useful to allow users to select multiple parameter values. To do this,
we need to modify our dataset to handle the multiple parameter inputs.
52 of 83
5. Enter the following values for the parameters and select OK:
a. @StartTime: Yesterdays date. For example 6/10/2013
b. @EndTime: Todays date. For example 6/11/2013
c. @DowntimeCode: Pump Stall
The results set will be filtered for the parameters entered:
53 of 83
54 of 83
Cascading Parameters
In previous exercises you may have noticed that some of the downtime code results had no data in the selected reporting time
range. Cascading parameters provide a way of managing large amounts of report data. With cascading parameters, the list of
values for one parameter depends on the value chosen in preceding parameter. In this exercise we configure the Downtime
Code parameter list to only show downtime codes available within the select reporting time period.
1. First we will edit the DowntimeCode dataset to accept the StartTime and EndTime parameters. Right-click
on the DowntimeCode dataset and select Dataset Properties.
2. Modify the Query to the following:
Select Distinct demoSAGDProductionLoss.DowntimeCode
FROM
demoSAGDProductionLoss
WHERE
StartTime >= @StartTime
AND
EndTime <= @EndTime
ORDER BY
demoSAGDProductionLoss.DowntimeCode
3. Select Refresh Fields.
4. Select Parameters. You will see that we now have a StartTime and EndTime parameter for this dataset.
5. Select the @StartTime and @EndTime parameters from the Parameter Value dropdown lists. This will
configure the DowntimeCode dataset to use the existing time period parameters.
55 of 83
7. Run the report. You should see that the list of available downtime codes is smaller than the full set shown
in the list in the previous exercise. Experiment with modifying the Start Time and End Time parameters to
see the Downtime Code list automatically update.
8. When finished with the report, return to Design mode and Save the report.
56 of 83
Charts
Charts enable you to present large volumes of aggregated information at a glance. It can more effectively convey information
than lengthy lists of data. Spending time carefully preparing and understanding your data before you create a chart will help you
design your charts quickly and efficiently.
1. We will add the chart to the top of the report. Start by expanding the report area and moving the objects to
create space for the new chart.
57 of 83
5. Select the pie chart data area to see the Chart Data configuration dialog.
58 of 83
6. Select the + symbol next to Values and then select the Datasets > ProductionLoss > DowntimeCode field
from the original dataset. This will tell our chart to use all of the DowntimeCode values from the dataset.
7. Next we need to tell the chart what to group by. When we selected the values for the chart it automatically
brought in the Details group. Use the dropdown next to details to change to grouping by DowntimeCode.
59 of 83
9. Select the outside border of the chart. Right-click and select Chart Properties.
60 of 83
14. The count of the downtime code occurrences is shown on the pie chart. Rather than show the counts, wed
rather see the percentage values for each downtime code. Right-click on one of the labels and select
Series Label Properties.
15. Enter #PERCENT{P1} for Label data. {P1} indicates the number of percentage decimal places to show on
the chart.
16. Select OK to close the Series Label Properties. When prompted to set the UseValueAsLabel property to
False select Yes and then select OK to close the Series Label Properties.
17. Right-click on the legend and select Legend Properties.
61 of 83
22. When finished viewing the report, return to Design mode and Save.
62 of 83
1. Right-click on the Downtime Cost column in the table and select Insert Column > Left.
2. In the last row of the new column, select the DowntimeCost field.
3. Select the two header row cells named Downtime Cost. Right-click on the cells and select Merge Cells.
63 of 83
4. Select the Field group cell under the first column of Downtime Cost. Right-click on the cell and select Insert
> Sparkline.
5. Select the first Line type of sparkline and then select OK.
64 of 83
8. Follow the same procedure to add a sparkline for downtime cost to the WellPad and WellPair groups.
9. Right-click on the cell containing the DowntimeCost field reference under the sparklines and select Insert >
Data Bar.
10. Select the Bar style of data bar and then OK.
65 of 83
11. Click to select the data bar so that the Chart Data editor is visible.
The chart data has already been populated since we selected an existing field in the chart. Had we placed
the summary calculation in the table cells where we added sparklines they also would have automatically
populated.
12. Widen the first column of Downtime cost so that it will be easier to see the sparkline results. Expand the pie
chart to fit the new table width.
Youll see that you now have sparklines and databars for the Downtime Cost. While they do not provide
detailed information, they do provide a general sense of how the downtime cost is trending. By using the
databars users can tell with a quick glance which downtime events caused the highest downtime cost.
14. When finished viewing the report, return to Design mode and Save.
66 of 83
Drillthrough Reports
A drillthrough report is a report that a user opens by clicking a link within another report. Drillthrough reports commonly contain
details about an item that is contained in an original summary report. The data in the drillthrough report is not retrieved until the
user clicks the link in the main report that opens the drillthrough report.
In this exercise we will create a new report containing a table of Downtime Code occurrences. We will then modify our existing
Downtime Cost Report to drill through to the new report.
1. We are going to use our existing Downtime Cost Report as a template for the new report so that we dont
have to reconfigure the datasets and parameters. With the Downtime Cost Report open, select the
ReportBuilder icon and then Save As.
2. Browse to Lab Reporting and name the new report Downtime Code History then select Save.
67 of 83
5. Select the table icon in the cell that is in the first column, second row of the table and select Datasets >
ProductionLoss > StartTime.
6. Follow the same procedure to add the EndTime, DowntimeCode,DurationSec, and DowntimeCost
dataset fields to the table. (You will need to add new columns by right-clicking on the far right column and
selecting Insert Column > Right)
8. Select the Details group under Row Groups (beneath the report editing area) and select Add Total >
Before.
68 of 83
10. Change the Text Box properties for the DowntimeCost and Sum(DowntimeCost) cells to a Number style
with Currency as the category. (Right-click on the cells and select Text Box Properties. Select Number
and then Currency)
11. Adjust the reporting objects so that your report looks like the screenshot below:
We now have a simple table that shows Downtime Code history only.
69 of 83
70 of 83
22. For the first parameter, select StartTime for the Name.
23. Select the fx button next to value.
71 of 83
24. We want to pass in the start time that is currently being used for the report. We can add the parameter value
to accomplish this. Select Parameters and double-click the StartTime value to add it to the expression.
27. For the third parameter, select DowntimeCode for the name.
28. Select the drop-down next to the Value for DowntimeCode and choose the DowntimeCode field from the
dataset. This will cause the downtime code that is being reported in the section of the pie chart that is
clicked to be passed into the Downtime code History report as a parameter.
72 of 83
29. Select Series Data. We will add a Tooltip for the chart to make it easier to tell which section we are clicking
on for the drill through.
30. Select the fx button next to Tooltip.
31. Select Fields (ProductionLoss). Double-click on DowntimeCode to add it to the expression.
73 of 83
The report is automatically filtered for the Start Date and End Date parameters in the Downtime Cost Report
and the downtime code we selected from the pie chart. The parameters are hidden in the drill-through
report but can be expanded and modified by selecting the arrow above the report toolbar.
This completes the exercises for creating SQL Server Reporting Services reporting content. In these exercises we used Report
Manager and Report Builder to create and edit reporting objects. Another choice not covered in this lab for creating and editing
SSRS content is the SQL Server Business Intelligence Development Studio. (BIDS). Business Intelligence Development Studio
is Microsoft Visual Studio with additional project types that are specific to SQL Server business intelligence. For more
information explore the Reporting Services help files and Microsoft content available online
74 of 83
Security
SQL Server Reporting Services (SSRS) offers several configurable options for authenticating users and client applications
against the report server. By default, the report server uses Windows Integrated authentication and assumes trusted
relationships where client and network resources are in the same domain or in a trusted domain. Depending on your network
topology and the needs of your organization, you can customize the authentication protocol that is used for Windows Integrated
authentication, use Basic authentication, or use a custom forms-based authentication extension that you provide. Each of the
authentication types can be turned on or off individually. You can enable more than one authentication type if you want the report
server to accept requests of multiple types.
When you start Report Manager, the pages, links, and options that you see will vary based on the permissions you have on the
report server. To perform a task, you must be assigned to a role that includes the task. A user who is assigned to a role that has
full permissions has access to the complete set of application menus and pages available for managing a report server. A user
assigned to a role that has permissions to view and run reports sees only the menus and pages that support those activities.
Each user can have different role assignments for different report servers, or even for the various reports and folders that are
stored on a single report server.
By default, SQL Server Reporting Services is configured to allow anyone in the Local Administrator group access to the website.
In this exercise we are going to modify the security permissions in Report Manager for another user on this image who is not an
Administrator. We will then login as the other user to see the security changes.
4. For Group or user name enter the user W2K8-FTVP1\SSRSUser. This is the name of a windows user on
this image.
75 of 83
5. Select the checkbox next to Browser. This will allow SSRSUser to see the content in Report Manager
without any edit rights.
6. Select OK.
7. Return to the Report Manager Home page.
8. Next we are going to give the SSRSUser additional permissions for the content we created in this lab.
Select the drop-down next to Lab Reporting and select Security.
76 of 83
9. Select Edit Item Security. When prompted to apply security settings different from the Home parent item
select OK.
10. Select Edit next to the SSRSUser.
11. Select the checkbox next to Content Manager. This will allow the user to edit items under the Lab
Reporting Folder in Report Manager.
15. Select the checkbox next to W2k8-FTVP1\SSRSUser and then Delete. This will remove access rights for
SSRSUser for this report even though the user has rights to the Lab Reporting parent folder. Select OK
when prompted to delete the security item.
77 of 83
16. Before we test the new security settings, we need to configure security for the data source. When we
configured the LabReporting_RACEDEMO data source, we indicated that we wanted to use Windows
Security for authentication. This means that the SSRSUser account will need to have access rights to the
RACEDEMO database. We can make this configuration change in SQL Server Management Studio.
From the Start menu select All Programs > Microsoft SQL Server 2008 R2 > SQL Server Management
Studio.
17. Select Connect to continue with our current Windows credentials.
18. Browse to Security > Logins. Right-click on the exiting login for SSRSUser and select Properties.
78 of 83
21. Under Database role membership, select the checkbox next to the db_datareader role. This will give the
user access to only view the data.
79 of 83
27. Select the dropdown next to FTEnergy and then select Delete. Select OK when prompted to delete.
As expected, we were not allowed to delete the FTEnergy folder since we only have read permissions for
everything except the Lab Reporting folder.
28. Return to the FTEnergy Folder and then select MeterReport. We can still access the reporting content
since we have view permissions.
29. Return to the Home page and select the Lab Reporting folder.
At this level we have options to edit content in Report Manager. However we still do not have permissions
to access Report Builder since we did not select them while editing Security.
We also cannot see the Downtime Code History report since we removed permissions to that report for this
user.
30. Select the Downtime Cost Report.
80 of 83
31. Select one of the sections of the pie chart to drill down into the Downtime Code History report.
As expected, we were also not able to view the report the report using drill through due to the security
settings.
This section provided a basic demonstration for configuration of simple security for SQL Server Reporting Services. For
advanced security settings and features, explore the Reporting Services help files and Microsoft content available online.
This completes the lab: Leveraging SQL Server Reporting Services (SSRS)
81 of 83
Notes
82 of 83
83 of 83