Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

59
SQL Server Reporting Services Bala Subra @bsubra @bsubra

description

How to use SQL Server 2008 R2 reporting services instead of ASP.NET for every data presentation problems? Where SSRS is superior to raw SQL? How it helps QA to automate their test cases?

Transcript of Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Page 1: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

SQL Server Reporting ServicesBala Subra@bsubra

@bsubra

Page 2: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Executive Summary

Delivered through: Traditional and interactive reports Scalable, manageable and embeddable

server infrastructure Integration with SharePoint, Office applications, browser and

other familiar tools Single platform and tools for all types of structured data

(relational, hierarchical, multidimensional)

Product enabling employees at all Product enabling employees at all levels of an organization to realize the levels of an organization to realize the promise of BI and to promote better promise of BI and to promote better decision makingdecision making

@bsubra

Page 3: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

BI User Profiles

Information Information ConsumersConsumers

Information Information ExplorersExplorers

5-10% of users5-10% of users

15-25% of users15-25% of users

65-80% of users65-80% of users

SQL ServerSQL ServerReportingReportingServicesServices

SQL Server SQL Server Analysis ServicesAnalysis Services

AnalystsAnalysts

@bsubra

Page 4: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

SQL Server CatalogSQL Server Catalog

Report Server

Reporting Services Architecture (2005)

Delivery

Delivery Targets(E-mail, File share,

Custom)

Security Services(NT, Passport,

Custom)

Security

Data Sources(SQL, OLE DB, ODBC,

Oracle, Custom)

Output Formats (HTML, Excel, PDF, Custom)

Report Processing

Browser

Management

Custom App

URLURL WMIWMI Web ServiceWeb Service

Data Retrieval Rendering

@bsubra

Page 5: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Reporting Services Architecture (2008)

@bsubra

Page 6: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Service Architecture (Reporting Services)

@bsubra

Page 7: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Component Architecture

@bsubra

Page 8: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Reporting Services available Web service development options

@bsubra

Page 9: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Business Scenarios

Enterprise Reporting In-house reports (Sales, Finance, HR)

Manageability, portal and LOB integration

Embedded Reporting Report processing included in applications

Extensible, embeddable architecture

B2B Reporting Partner reporting via extranets, Internet

Data isolation, extensible security

@bsubra

Page 10: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

AuthoringAuthoring ManagementManagement DeliveryDelivery

Reporting Lifecycle

SQL Server Reporting Services supports the full SQL Server Reporting Services supports the full reporting lifecycle, including Authoring, reporting lifecycle, including Authoring, Management and DeliveryManagement and Delivery

@bsubra

Page 11: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Report Authoring

Report Designer Integrated with Visual Studio Powerful, XML Report Definition Language (RDL)

Freeform / Table / Matrix / Chart / Tablix Parameters (Dynamic, Hierarchical) Sorting / Filtering / Grouping / Aggregates Interactivity (Drill-down, Drill-through) Full VB.NET Expression Language

Published RDL definition to enable 3rd parties to create custom authoring tools

Extensible query execution architecture SQL Server / Analysis Services OLE DB / ODBC / Oracle

@bsubra

Page 12: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Report Management

Web Service APIs for management Web management user interface Report Management Functions

Report Metadata (Name, Description, Connections, Credentials, Parameters)

Scheduling integrated with SQL Server Agent Execution properties (live, cache or snapshot) History of prior executions

Extensible, role-based security architecture

@bsubra

Page 13: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Report Delivery

Single report definition can be rendered to diverse output formats Web Formats (HTML 4, HTML 3.2, HTML w/OWC) Print Formats (TIFF, RTF, PDF) Data Formats (Excel, XML, CSV)

Personalized and administrator defined subscription and delivery Ability to select output formats per subscription Can deliver links as well as rendered reports Data-driven subscriptions for personal delivery

Extensible delivery provider architecture E-mail, File System, Custom

@bsubra

Page 14: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Reporting Services Terminology

Data Source – a database Dataset – a query against a data source Data Region – an item that displays repeated rows

of data Types of Data Regions

Table – a banded, tabular report Matrix – a cross-tab (or pivot table) report List – data arranged in free-form fashion Chart – a graph

@bsubra

Page 15: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Creating Reporting Services Project

Creating a Report Creating a Group Interactive Sorting Creating Drill-Down Reports

@bsubra

Page 16: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Calculations & Formatting

Reporting Services uses VB-like expressions You can use standard +. -, *, /, mod operators String concatenation with & (don’t use +)

Aggregate functions: Sum, Count, Avg, Min, Max, First, Last, etc.

Also supported: IIf(), Len(), Switch()

@bsubra

Page 17: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Expressions

Fields to access values from current row e.g. =Fields!LastName.Value

Globals to access global report data e.g. =Globals!PageNumber

User to access info about authenticated user running the

report e.g. =User!UserID; =User!Language

@bsubra

Page 18: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Expressions

Parameters to access value of input parameters e.g., =Parameters!Country.Value

ReportItems to access values from other sections of report e.g.= ReportItems!txtQuantity.Value *

@bsubra

Page 19: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Using Custom Code You can write your own VB functions and

include them in the Code tab of the Report|Report Properties dialog

Visual Basic is the only language supported by SSRS in the code window

You can also develop custom assemblies that you can call from reports Assemblies can be developed in any .NET

language You have to follow a number of steps to reference,

deploy, and access your assemblies

@bsubra

Page 20: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Custom Code Example

Public Function ColumnSel (ByVal parameter as Parameter, ByVal ColID as integer) as Boolean

If parameter.IsMultiValue then For i as integer = 0 to parameter.Count-1 If val(parameter.Value(i)) = ColID

then Return True End If Next Return False Else Return False End If Return FalseEnd Function

@bsubra

Page 21: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Formatting Fields

Conditional Formatting Use IIf, Switch, or a custom function as value for

property in property sheet You can do this for textboxes and table rows

(sections of a report) Need to display sales over $1,000 bolded and

in green

@bsubra

Page 22: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

@bsubra

Page 23: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Themes Core Product Enhancements

Extend features based on feedback Incremental enhancements, performance and scalability

Tighter Integration Strengthen SQL Server end-to-end BI scenarios Tighter integration with Office and SharePoint

Developer Focus Unparalleled integration for the Visual Studio developer Freely redistributable Windows and ASP.NET controls

Empowering End Users Report Builder enables end-user reporting scenarios Increased interactivity

@bsubra

Page 24: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Feature sets

Report Builder VS Integration VS Controls Interactive Sort Multi-valued parameters Parameter Date Picker Management Studio

Integration MDX Query builder

Configuration Tool Custom Report Item Floating headers Printing from IE (SP2) Web Parts (SP2) 64 bit Support Multi-instance Support Expression builder

enhancements

@bsubra

Page 25: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

@bsubra

Page 26: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Most Requested Items

PPT rendering Shared Styles (Styles sheets) Templates Font embedding in PDF Many Chart enhancement Heterogeneous Join Edit in Preview

@bsubra

Page 27: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Rich Client Printing

Direct routing of print jobs without needing to export

Small ActiveX control downloaded via browser

Select page range, orientation, margins

Preview page output Server enhancements for

performance

@bsubra

Page 28: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Enhanced Expression Editor

Available for all expressions in VS Report Designer

List of available VB.NET functions

Inline parameter information

Statement completion

Real-time syntax checking

@bsubra

Page 29: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Multi-Valued Parameters

Report developer can specify any parameter is multi-valued

Report processing constructs SQL or MDX syntax

Multiple default values also supported

Value sets can passed via URL or SOAP API

@bsubra

Page 30: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Date Picker Parameters

Calendar control for choosing dates

Localized and Globalized

Windows and Web support

@bsubra

Page 31: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Interactive Sort

Report author can add ability for end user to resort data within data regions

Resorting happens without re-querying the database

Support for multi column and for nested / grouped sort

@bsubra

Page 32: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Floating Headers

New type of interactivity similar to freeze panes in Excel

Works Horizontally and Vertically Table header Matrix column and row headers Table columns

Must be continuous columns anchored on the right or left

@bsubra

Page 33: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

SQL Server 2008 R2 Enhancements New Data Sources

SharePoint List SQL Azure SQL Server Parallel Data Warehouse

Combining Data from More Than One Dataset Conditional Rendering Expressions

=iif(RenderFormat.Name="EXCEL", True, False)

Read/Write Report Variable Shared Datasets Report Parts

@bsubra

Page 34: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Data Synchronization

DomainScope

Text Box Orientation

@bsubra

Page 35: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Data Visualization

Data Bars Sparklines Maps Indicators

@bsubra

Page 36: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

MDX Query Builder

MDX and data mining query builders

MDX parameter support

Member extended properties

Support for server aggregates

@bsubra

Page 37: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Custom Report Item

Enables ISVs and Developers to add custom visualizations to a report Primary scenario is enhanced charting

Additional chart types Maps Gauges

Supports interactivity Actions Sort

Supports all data region features Filter Grouping Group Filters Etc…

The Report Designer supports a conversion API

Currently limited to images Future plans for all report item types

@bsubra

Page 38: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Management Studio Integration

Single point of management for all SQL Server components

Superset of Report Manager functions

Script generation from property dialogs

@bsubra

Page 39: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Server Configuration Tool

Graphical configuration tool for Report Server Database Settings Virtual Directories E-Mail Key Management

@bsubra

Page 40: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

SharePoint Web Parts

Report Explorer provides browsing of server namespace and subscription

Report Viewer used to view reports

Parts can be connected or used standalone

Works in both SPS and WSS

@bsubra

Page 41: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Visual Studio Integration

Report design completely integrated with Visual Studio language projects

Natural extension of VS data functionality

Included in VS Pro and above

@bsubra

Page 42: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Report Controls Controls make it easy

to embed reporting functionality into applications

Windows Forms (rich client) and Web Forms (ASP.NET) control

Local processing mode (no server) or connected server mode

@bsubra

Page 43: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Report Builder

A new ad-hoc report design tool for Reporting Services

Targeted at business users who want to find and share answers to interesting questions

Driven from a business model of the data so users do not need to understand the underlying data structures

Fully integrated with Reporting Services and delivered in SQL Server

@bsubra

Page 44: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Why Report Builder?

Report Report ConsumersConsumers

Business Business UsersUsers

Report Viewer

Report Builder

Power UsersPower UsersDevelopersDevelopers Report Designer

@bsubra

Page 45: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

What Report Builder is not…

A replacement for Pivot Tables Can be used for some data slice and dice but not specifically

designed for this capability An analytical client

No support for advanced financial calculations, what ifs, writebacks, financial or business modeling, etc.

A developer-focused design tool No nested data regions, freeform layout, multiple queries,

conditional formatting, or custom code An HTML-based design tool

Report Builder is a WinForms (.NET Framework) application

@bsubra

Page 46: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Report Builder Architecture

SQL Server CatalogSQL Server CatalogSQL Server CatalogSQL Server Catalog

Web Service / URL interfaceWeb Service / URL interfaceWeb Service / URL interfaceWeb Service / URL interface

Report ServerReport Server

Report BuilderReport BuilderClientClient

Report BuilderReport BuilderClientClient

ModelModelDesignerDesigner

ModelModelDesignerDesigner

Data Sources(SQL Server,

Analysis Services)

Drill through report generationDrill through report generation

Query generationQuery generation

ReportReport ManagerManager

ReportReport ManagerManager

ReportReportDesignerDesigner

ReportReportDesignerDesigner

SQL MgmtSQL MgmtStudioStudio

SQL MgmtSQL MgmtStudioStudio

@bsubra

Page 47: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Report Builder Client

Built on top of familiar Microsoft Office paradigms (Excel, PowerPoint)

Reports built via report templates (table, matrix, chart, combinations)

“Click once” application deployed from the Report Server

Users download and launch the client from Report Manager (new or existing report)

Finished reports can be saved on the server

@bsubra

Page 48: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Report Builder Reports

Report Builder reports are just like any other Reporting Services report… Report Builder reports are defined in RDL Managed by the same APIs Secured by the same APIs

Except: Report Builder reports contain semantic model metadata When an Report Builder report is requested by report

processing, the metadata is used to generate a query in the source language

A new component on the Report Server handles the query generation

@bsubra

Page 49: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Infinite Drill

Automatic generation of new drillthrough reports allows users to explore data along model navigation paths

Queries for navigation reports are generated on the fly, passing the context of the user’s current “location”

Users can keep drilling as long as there is a path to follow from the current item

Custom reports can be specified for model items Generated navigation reports are not saved unless

the user explicitly saves them

@bsubra

Page 50: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Report Builder Model Designer

Hosted in Visual Studio (new project type)

For editing models used by Report Builder

Auto-generation of models from data sources

@bsubra

Page 51: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Model Design

Model Designer is interface for designing/editing a model New project type in BI Development Studio Define fields and roles Define calculated fields Organize model

Models can be auto-generated in Model Designer or on the Report Server Generates entities, fields and roles based on source

metadata Auto-generation against SQL Server and Analysis Services

databases

@bsubra

Page 52: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Model Designer

@bsubra

Page 53: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Report Models Models define entities, fields and roles available for Report

Builder Models reference a data source (either SQL Server or Analysis

Services)

Models are stored in the Report Server as a new item type Includes new management APIs

Published models can be secured Items within models (entities, fields, roles) can also be secured Users only see items they have permissions to see

Model security and management through SQL Server Management Studio

@bsubra

Page 54: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Report Builder vs. Report DesignerReport Builder Report Designer

Targeted at business users Targeted at IT pros and developers

Ad hoc reports Managed reports

Auto-generates queries using semantic layer on top of the source

Native queries (SQL, OLE DB, XML/A, ODBC, Oracle)

Reports built on templates Free-form (nested, banded) reports

Click-once application, easy to deploy and manage

Integrated into Visual Studio

Cannot import Report Designer reports

Can work with reports built in Report Builder

@bsubra

Page 55: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Wrap-up

Report Builder is… a new ad hoc report design tool for SQL Server Reporting

Services targeted at business users who want to find and share

answers to interesting questions driven from a business model of the data so users do not

need to understand the underlying data structures is fully integrated with SQL Server Reporting Services and

delivered in SQL Server

@bsubra

Page 56: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Comparing Report Authoring Environments

@bsubra

Page 57: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

SQL Server Report Builder

@bsubra

Page 58: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Planning a Deployment Topology

@bsubra

or

Page 59: Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2

Thank You!

@bsubra