sql server 2000: report authoring with sql server reporting services peter blackburn book:...

32
SQL Server 2000: Report SQL Server 2000: Report Authoring with SQL Server Authoring with SQL Server Reporting Services Reporting Services Peter Blackburn Peter Blackburn Book: ‘Hitchhiker’s Guide to SQL Server 2000 Book: ‘Hitchhiker’s Guide to SQL Server 2000 Reporting Services’ Reporting Services’ Windows Server Systems – SQL Server MVP Windows Server Systems – SQL Server MVP DAT368 DAT368

Upload: horace-daniel

Post on 22-Dec-2015

242 views

Category:

Documents


1 download

TRANSCRIPT

SQL Server 2000: Report Authoring SQL Server 2000: Report Authoring with SQL Server Reporting Services with SQL Server Reporting Services

Peter Blackburn Peter Blackburn Book: ‘Hitchhiker’s Guide to SQL Server 2000 Reporting Services’Book: ‘Hitchhiker’s Guide to SQL Server 2000 Reporting Services’Windows Server Systems – SQL Server MVPWindows Server Systems – SQL Server MVP

DAT368 DAT368

GoalsGoals

Encourage you to purchase the bookEncourage you to purchase the book

Overview of Reporting ServicesOverview of Reporting Services

Demonstrate range of report Demonstrate range of report design featuresdesign features

Build two reports adding complexityBuild two reports adding complexity

Discuss key report definition conceptsDiscuss key report definition concepts

Mention some tips and tricksMention some tips and tricks

What does Reporting Services do?What does Reporting Services do?

““SQL Reporting Services 2000 can serve reports SQL Reporting Services 2000 can serve reports over the inter- or intra- net, based on data from over the inter- or intra- net, based on data from *any* source directly into many *any* source directly into many formats including:- html, pdf, excel, csv, image formats including:- html, pdf, excel, csv, image formats.”formats.”

Yes, it’s a web application\service Yes, it’s a web application\service

Reporting ServicesReporting Services

DemoDemo

Internet Information Server (IIS)

Reporting Services ArchitectureReporting Services Architecture

URL & SOAP Interfaces

Report ServerReport Server

Report Processor

Data Processing

Data Sources(SQL, OLE DB, XML/A, ODBC, Oracle, Custom)

Report Rendering

Output Formats HTML, Excel, PDF, CSV, XML…

SQL Server Catalog

SQL Server 2000

VS.NET Report VS.NET Report DesignerDesigner

Report ManagerReport ManagerReportServer WebReportServer WebServiceService

Security

Delivery Targets(E-mail, FileShare,

Custom)

Scheduling & Delivery

Principal ComponentsPrincipal Components

Report Designer Report Designer

Add In to Visual Basic .NET 2003 (or Visual Studio .NET 2003)Add In to Visual Basic .NET 2003 (or Visual Studio .NET 2003)

Report Server

IIS hosted Web ServiceIIS hosted Web Service

Stores, Processes, Renders, Serves Reports over httpStores, Processes, Renders, Serves Reports over http(s)(s)

Report ManagerReport Manager

IIS hosted Web Application IIS hosted Web Application

Manage Manage Reports Reports

Windows Report ServiceWindows Report Service

System ServiceSystem Service

Executes and delivers scheduled Reports Executes and delivers scheduled Reports

Minimum Requirements Minimum Requirements

Report ServerReport Server

Windows 2000 Professional (Server Editions Recommended)Windows 2000 Professional (Server Editions Recommended)

SQL Server 2000 SQL Server 2000

Standard Edition with Service Pack 3AStandard Edition with Service Pack 3A

Internet Information ServerInternet Information Server

UsersUsers

Any device with a web browser capable of html 3.0Any device with a web browser capable of html 3.0

HOWEVER Internet Explorer – is HOWEVER Internet Explorer – is highlyhighly recommended recommended

DevelopersDevelopers

Visual Basic .NET 2003Visual Basic .NET 2003

Creating ReportsCreating Reports

Use Report Designer hosted in Use Report Designer hosted in Visual Studio .NET 2003Visual Studio .NET 2003

Start with Report wizard or blank reportStart with Report wizard or blank report

Import from Microsoft Access XP or 2003Import from Microsoft Access XP or 2003

Charts and code-behind are not importedCharts and code-behind are not imported

Redesign your top reports to use Reporting Services featuresRedesign your top reports to use Reporting Services features

Use 3rd party tools that target Use 3rd party tools that target Reporting ServicesReporting Services

Proclarity, Panorama, Cizer, MIS AGProclarity, Panorama, Cizer, MIS AG

Full list at: Full list at: http://www.microsoft.com/http://www.microsoft.com/sqlsql/reporting/reporting

Creating ReportsCreating Reports

DemoDemo

Report ItemsReport Items

TextboxTextbox

ImageImage

LineLine

RectangleRectangle

SubreportSubreport

Data Regions (List, Table, Matrix, Chart)Data Regions (List, Table, Matrix, Chart)

Custom Report Items coming in Custom Report Items coming in SQL Server 2005!SQL Server 2005!

£100,000£100,000

Item StylesItem Styles

All Report ItemsAll Report Items

Background ColorBackground Color

Background ImageBackground Image

Border ColorBorder Color

Border StyleBorder Style

Border WidthBorder Width

PaddingPadding

ChartsCharts

Background GradientBackground Gradient

TextboxesTextboxes

ColorColor

Font FamilyFont Family

Font SizeFont Size

Font StyleFont Style

Font WeightFont Weight

FormatFormat

Line HeightLine Height

Text AlignText Align

Text DecorationText Decoration

Vertical AlignVertical Align

ListsLists

Repeating regions with Repeating regions with freeform layoutfreeform layout

Similar to “bands” in other Similar to “bands” in other report writersreport writers

But multiple lists can sit side-But multiple lists can sit side-by-side!by-side!

Lists inside lists to get Lists inside lists to get multiple levels multiple levels of groupingof grouping

Use for complex repeating Use for complex repeating areasareas

BrianBrian

JasonJason

SteveSteve

£10,000£10,000

£20,000£20,000

£30,000£30,000

TablesTables

Like lists with columnsLike lists with columns

Fixed columns, Fixed columns, repeating rowsrepeating rows

Table cells can Table cells can span columnsspan columns

Multiple table rows Multiple table rows per recordper record

Table cells can contain any Table cells can contain any report itemreport item

Faster and smaller than listsFaster and smaller than lists

Easier to align itemsEasier to align items

Use for most reportsUse for most reports

£80,000£80,000Grand TotalGrand Total

£50,000£50,000EastEastTotalTotal

£30,000£30,000NorthNorthTotalTotal

SalesRegionPerson

£50,000£50,000EastEastSteveSteve

£20,000£20,000NorthNorthDanDan

£10,000£10,000NorthNorthBrianBrian

MatricesMatrices

Repeats in row and Repeats in row and column directionscolumn directions

Also known as pivot table or Also known as pivot table or cross tabcross tab

Arbitrary formatting Arbitrary formatting in headersin headers

Different formatting Different formatting for subtotalsfor subtotals

Matrix cells can contain any Matrix cells can contain any report itemreport item

Use when column headings Use when column headings are records in your dataare records in your data

£720£720£760£760£600£600Total

£300 £300 £400 £400 £300 £300 Steve

£300 £300 £250 £250 £200 £200 Jason

£120 £120 £110 £110 £100 £100 Brian

200220022001200120002000SalesSales

ChartsCharts

Data from fields in Data from fields in the data setthe data set

or from expressionsor from expressions

Full set of chart properties Full set of chart properties and typesand types

Style enhancementsStyle enhancementsin SP1in SP1

Same data functionality Same data functionality as Matrixas Matrix

ExpressionsExpressions

Most properties take expressionsMost properties take expressionsValues from the data setsValues from the data sets

Values of other items on the reportValues of other items on the report

Values of global properties and user propertiesValues of global properties and user properties

Expressions use Visual Basic .NET syntaxExpressions use Visual Basic .NET syntax

Aggregates: Sum, Avg, Count, Min, First, etc.Aggregates: Sum, Avg, Count, Min, First, etc.

ExamplesExamples=Fields!Name.Value=Fields!Name.Value

=Fields!First.Value & " " & Fields!Last .Value=Fields!First.Value & " " & Fields!Last .Value

=Sum(Fields!Sales.Value)=Sum(Fields!Sales.Value)

=IIf(Sum(Fields!Sales.Value)>10, "green", "red")=IIf(Sum(Fields!Sales.Value)>10, "green", "red")

ParametersParameters

Report parameters can be used in report expressions Report parameters can be used in report expressions (including binding to query parameters)(including binding to query parameters)

Set of valid values and default values can be static or Set of valid values and default values can be static or query-basedquery-based

Parameters can be hierarchicalParameters can be hierarchical

Selection of parameter value can drive later Selection of parameter value can drive later valid valuesvalid values

Accessed using global Parameters collection, e.g.Accessed using global Parameters collection, e.g.

=IIF(Fields!Sales.Value > Parameters!Goal.Value, “PASS", =IIF(Fields!Sales.Value > Parameters!Goal.Value, “PASS", “FAIL")“FAIL")

Making Reports InteractiveMaking Reports Interactive

Actions can be added to report itemsActions can be added to report items

Drill down within a report Drill down within a report

Drill through to a different reportDrill through to a different report

Bookmarks jump within a reportBookmarks jump within a report

Hyperlinks any web pageHyperlinks any web page

Document map shows report structureDocument map shows report structure

Green BarGreen Bar

Conditional formatting on contents of table cellsConditional formatting on contents of table cells

Background color expressionBackground color expression

=iif(RowNumber(Nothing) Mod 2,“Green","White")=iif(RowNumber(Nothing) Mod 2,“Green","White")

Page Break After N RowsPage Break After N Rows

““Hidden” page break groupingHidden” page break grouping

Group expressionGroup expression

=Ceiling(RowNumber(Nothing)/30)=Ceiling(RowNumber(Nothing)/30)

No header or footerNo header or footer

Page break at end of groupPage break at end of group

Running TotalRunning Total

Running aggregate functionRunning aggregate function

=RunningValue(Fields!SalesAmt.Value, Sum, =RunningValue(Fields!SalesAmt.Value, Sum, Nothing)Nothing)

Simulated End-User SortingSimulated End-User Sorting

““Sort By” report parameterSort By” report parameter

Values = Names of fields to sort byValues = Names of fields to sort by

““Direction” report parameterDirection” report parameter

Values = Ascending, Descending, NoneValues = Ascending, Descending, None

Simulated End-User SortingSimulated End-User Sorting

Two sort expressions on tableTwo sort expressions on table

Ascending sortAscending sort

=iif(Parameters!Direction.Value= "Ascending",=iif(Parameters!Direction.Value= "Ascending",

Fields(Parameters!SortBy.Value).Value,0)Fields(Parameters!SortBy.Value).Value,0)

Descending sortDescending sort

=iif(Parameters!Direction.Value= “Descending",=iif(Parameters!Direction.Value= “Descending",

Fields(Parameters!SortBy.Value).Value,0)Fields(Parameters!SortBy.Value).Value,0)

SQL Server 2005 will have auto-sort and filter SQL Server 2005 will have auto-sort and filter built in!built in!

Simulated “All” ParametersSimulated “All” Parameters

String parameter (Country)String parameter (Country)

Query contains “like @Country”Query contains “like @Country”

Valid Values list contains “All”Valid Values list contains “All”

Mapped to value of “%”Mapped to value of “%”

Deploying ReportsDeploying Reports

Copies reports, images, and data sources to Copies reports, images, and data sources to Report Server via Web ServiceReport Server via Web Service

After you deployAfter you deploy

Set security permissionsSet security permissions

Set up caching and scheduled executionSet up caching and scheduled execution

Set up subscriptionsSet up subscriptions

Bask in the admiration of your co-workers!Bask in the admiration of your co-workers!

For more informationFor more information

Visit Visit www.sqlreportingservices.netwww.sqlreportingservices.net

Site offers premium content for book ownersSite offers premium content for book owners

ISBN: 0321268288; Published: Oct 8, 2004; Pages: 768

Includes DVD with over 2.5GB of tutorial videos

Only book to include updates for SP1

What the Development Team SayWhat the Development Team Say

“I learned new things when I read it”

Bill Baker, General Manager, SQL Server Business Intelligence, Microsoft Corporation

[email protected]

Serious ComplaintSerious ComplaintFrom: Rob Gray (Microsoft UK) Sent: 26 November 2004 10:53To: Peter BlackburnSubject: Serious Complaint about your book

 

Hi Peter 

I have a massive complaint about your book. I usually use technical books as a cure for insomnia, and they usually prove to be quite effective.

 

Your book, however, has let me down… 

I’ve been reading the foreword etc. over the last few weeks whenever I’ve had a chance, but last night I started reading the first “real” chapter. Now rather than the book being a cure for insomnia, I ended up only getting to sleep sometime after 01:30am (I’m usually asleep by 11). A Technical book isn’t MEANT to be interesting or amusing, and DEFINITELY not intriguing! What’s going on!!??

 

This is also the first time that I’ve laughed out loud while reading a technical book. In fact I’ve only laughed out loud once or twice in my life when reading ANY book, including ones that are meant to be funny.

 

PLEASE MAKE THE NEXT EDITION BORING SO THAT I CAN AT LEAST GET TO SLEEP AT NIGHT!!

 

On a serious note, congrats on a great and fun-to-read book. I’m sure you can expect some feedback from us as we work though it!

Definitely on my “recommended reading” list. 

Cheers,

Rob

Additional ResourcesAdditional Resources

Reporting Services web siteReporting Services web site

http://www.microsoft.com/sql/reportinghttp://www.microsoft.com/sql/reporting

Reporting Services newsgroupReporting Services newsgroup

news:microsoft.public.sqlserver.reportingsvcsnews:microsoft.public.sqlserver.reportingsvcs

Course 2030: Creating Reporting SolutionsCourse 2030: Creating Reporting Solutions

http://www.microsoft.com/traincert/syllabi/http://www.microsoft.com/traincert/syllabi/2030AFinal.asp2030AFinal.asp

SQL Server Community SitesSQL Server Community Sites

http://www.microsoft.com/sql/community/http://www.microsoft.com/sql/community/

Community ResourcesCommunity Resources

My Web SiteMy Web Site

http://www.SqlReportingServices.NET http://www.SqlReportingServices.NET

Community ResourcesCommunity Resourceshttp://www.microsoft.com/communities/default.mspxhttp://www.microsoft.com/communities/default.mspx

Most Valuable Professional (MVP)Most Valuable Professional (MVP)http://www.microsoft.com/communities/mvphttp://www.microsoft.com/communities/mvp

NewsgroupsNewsgroups

Converse online with Microsoft Newsgroups,Converse online with Microsoft Newsgroups,including Worldwideincluding Worldwidehttp://communities2.microsoft.com/communitieshttp://communities2.microsoft.com/communities/newsgroups/en-us/default.aspx/newsgroups/en-us/default.aspx

User Groups - Meet and learn with your peersUser Groups - Meet and learn with your peershttp://www.microsoft.com/communities/usergroupshttp://www.microsoft.com/communities/usergroupsdefault.mspxdefault.mspx

© 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.© 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only.MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.