microsoft sql server reporting services dave henson [email protected]

72
Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks .com

Upload: andrew-oliver

Post on 22-Dec-2015

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Microsoft SQL Server Reporting Services

Dave Henson

[email protected]

Page 2: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Why Use SSRS

• Secure Deployment of Professional Reports

• Accessible Anywhere – web based• Define one report, render to many formats

– Html– Pdf– Xml

• Integrated with SQL 2008• Easily extensible for .net developers

Page 3: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Course Outline

• Module 1: Introduction to Microsoft SQL Server Reporting Services(SSRS)

• Module 2: Authoring Basic Reports• Module 3: Enhanced Reporting• Module 4: Manipulating Data Sets• Module 5: Managing Content• Module 6: Administering SSRS• Module 7: Programming SSRS

Page 4: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Course Logistics

• Class Format– 50% Lecture & Demonstrations– 50% Lab

• Course Dates

• Course Hours

• Lunch

Page 5: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Definitions

• SSRS• RDL• XML• Business Intelligence (BI)• OLTP• OLAP• OLEDB• .Net

•IIS•SQL•Visual Studio .Net 2005

Page 6: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Reporting Lifecycle

• Authoring to create .rdl file• Management

– Security– Deployment

• Delivery– Pull

• Report Manager• Custom App

– Push• Email• Custom App

Page 7: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Reporting Services Scenarios

• Internal

• External

• Embedded – online portal

• Standard vs. Ad-hoc Reports

Page 8: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Delivery and Rendering Options

• HTML, MHTML• PDF, TIFF• CSV, XML• Custom .Net Rendering

• Content:– Standard, Crosstab, Charting, Graphics

• Real time or scheduled as a task

Page 9: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

SSRS Architechture

• Report Server– http://localhost/reportserver

• Report Manager– http://localhost/reports

Page 10: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

SSRS Components

• Application layer– Report Authoring

• Standard• Ad Hoc

– Report Server Management

• Server Layer– Report Server– Report Processor

• Data Layer– Any OLEDB Datasource

Page 11: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Authoring Components

• Report designer templates added to Visual Studio during install

• Report Builder– Thin client .net app

installed through browsing– Uses a published report

model to build query

• Reporting Services API for authoring

Page 12: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Management Components

• SSRS Configuration Tool

• Report Manager

• Command Line– Rsconfig– Rs– Rskeymgmt

• SSRS API

Page 13: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Report Delivery Components

• Report Manager

• Report Processor

• Scheduling and Delivery Processor

Page 14: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Server Extensions

• SSRS fully exposed through .net libraries

• Extensibility– Authentication– Data Processing– Report Processing– Rendering– Delivery

Page 15: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Installation

• Prerequisites– Windows Server (2003/2008)– IIS– SQL Server – local to machine or otherwise

• Versions– Workgroup(Express)– Standard– Enterprise– Trial

Page 16: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Server Configuration

• IIS

• Security Accounts

• SSRS Config Manager

• SSRS Services and accounts– Windows Service– Web Service– Impersonation

Page 17: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

SSRS Quick Tour

• Demonstration of basic reporting:– Create BI Project– Add Datasource– Add Dataset– Design Report– Deploy Report

Page 18: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Module 2: Authoring Basic Reports

Page 19: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Visual Studio 2008 – New BI Project

Page 20: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Data Source Setup

Page 21: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Adding the dataset

Page 22: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Structuring Data in the Report

Page 23: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Report Layout and Presentation

Page 24: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Publishing the Report

Page 25: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Managing the Report

Page 26: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Accessing the Report

Page 27: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Module 3: Enhanced Reporting

Page 28: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Parameters

• Replace items in where clause with sql named parameters

• Use a query to populate a dropdown for the parameter

Page 29: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Formatting

• Use .Net formatting rules in the “format” property:

• 0N = number: 100.99

• 0C = money: $100.99

Page 30: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Filters

• Blanket reduction of rows returned from the dataset

Page 31: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Data Regions

• Areas on report with repeated data:– Table: fixed columns– Matrix: variable columns– List

• Subreports

Page 32: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Actions

• Link a report item to data stored elsewhere– Report– Url (.aspx, .php, .htm)

Page 33: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Visibility

• Use “Hidden” property to hide fields, rows, etc.

• Use the ToggleItem property for interactive control of visibility

Page 34: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Recursive Groups

• Using Parent Grouping in the Grouping Properties for recursive display

• Use the Level function to identify the relationship of the current row to the top row=Level(“RecursiveGroup”)

Page 35: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Module 4: Managing Datasets

Page 36: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

IIS Session

• Report execution is stored by default in user session

• Cached instances share the report across multiple sessions(multiple visitors)

Page 37: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Working with a shared schedule

• Create a master schedule used by a series of reports for updating cached information

Page 38: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Snapshot Reports

• Report is executed on a scheduled basis and delivered to a folder

Page 39: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Report parameters

• Parameters used as a “filter” can be used against the snapshot data

Page 40: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Calculation Load

• Structure of your query defines the load point of running the report:– SQL Backend– Reporting Services Engine

Page 41: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Manual Caching

• Running an SQL job to create a table with the results of a report– Pre-aggregating

Page 42: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Module 5: Managing Content

Page 43: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Publishing Content

• Report Designer• Report Manager

• SQL Server Management Studio

• Rs.exe and .rss file

• .Net libraries

Page 44: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Enabling User Reports

• Enable a My Reports folder for each user

Page 45: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Report Builder

• .net library delivered over the web

• Allows power users to create their own reports

• Requires a report “model” be published by admin– Describes tables and relationships– Published as SMDL file– Data Source View (DSV) enables subset of base data

Page 46: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Reverse-Scripting Objects

• Visual Studio Script Generation

• .rss script file can be used with the rs.exe utility

Page 47: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Data Sources

• Updates needed through time– Report Manager– Visual Studio .Net 2005

Page 48: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Configuring Snapshot Reporting

Page 49: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Snapshot Report History

• Viewing

• Configuring

Page 50: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Report Subscriptions

• Supports the push model of reporting

Page 51: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Cross Platform Reporting

• See web for fixes on your platform

• You must test all os/browser platforms

• Example: Firefox– Width: single pixel clear gif, width of 6.5 in– Height: modify reportingservices.css

• .DocMapAndReportFrame{min-height: 860px;}

Page 52: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Module 6: Administering SSRS

Page 53: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Reporting Services Files and Folders

• C:\program files\Microsoft SQL Server\MSSQL.3\Reporting Services

• C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin\ReportingServicesService.exe.config

Page 54: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Reporting Services Databases

• ReportServer.dbo.ExecutionLog

Page 55: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Trace Log Files

• C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\LogFiles

• Configure logging level in the ReportinServices.exe.config file

Page 56: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

SSRS Windows Performance Counters

• MSRS 2005 Web Service Counters

• MSRS 2005 Windows Service Counters

Page 57: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Timeouts

• Connection:– Connection Timeout– Command Timeout– Lock Timeout

• Report Execution Timeout

Page 58: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Suspending Jobs

• Subscriptions

• Shared Schedules

Page 59: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

SSRS Database Administration

• Role of the database

• Backup Schedule

Page 60: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Security: Authorization Model

• SQL Server Logins– Trusted – Nontrusted

• Default Settings – trusted only– Need to modify for snapshot execution

Page 61: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Assigning Roles

• Windows Accounts

• Using “runas” for testing– Ctrl – right click internet explorer– Choose runas– Supply another windows login for execution

Page 62: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Item-Level Role Definitions

• Browser

• Content Manager

• My Reports

• Publisher

• Report Builder

Page 63: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Folder Security

Page 64: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Site Security

• System Administrator

• System User

Page 65: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Module 7: Programming SSRS

Page 66: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

SSRS Extensibility

• Client Reporting Interface

• Management/Administration

• Custom Reporting Objects

Page 67: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Tools

• Reporting Services Command Prompt– Rs.exe– Rsconfig.exe

• Compilers:–Csc.exe

–Vbc.exe

Page 68: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

HTTP Protocol

• HTTP Post

• HTTP Get

• WebForms

Page 69: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Custom Web Reporting Portal

• Add Parameters to url:– &rc:ParmName=ParmValue

• To Hide parameters– &rc:Parameters=false– &rc:Toolbar=false

• Other control features– &rc:Zoom=75– &rc:Zoom=Whole Page– &rc:Extension=.TXT– &rs:format=EXCEL

Page 70: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Reporting Services API

• .Net Libraries

• Web Services

Page 71: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Example Client Code public Form1() { InitializeComponent();

//add reference to Microsoft.ReportViewer.WinForms

//add namespaces System.Data.SqlClient and Microsoft.Reporting.WinForms;

this.ClientSize = new System.Drawing.Size(950, 600);

ReportViewer reportViewer = new ReportViewer();

// Set Processing Mode reportViewer.ProcessingMode =

ProcessingMode.Local;…

Page 72: Microsoft SQL Server Reporting Services Dave Henson dhenson@certifiednetworks.com

Example Contd.… // Set RDL file reportViewer.LocalReport.ReportPath = @"c:\tmp\

productlist.rdl";

// Supply a DataTable corresponding to each report data source

reportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", DBUtil.GetProducts()));

// Add the reportviewer to the form reportViewer.Dock = DockStyle.Fill; this.Controls.Add(reportViewer);

// Process and render the report reportViewer.RefreshReport(); }