Microsoft®SQLServer2005ReportingServices
ByMichaelLisin,JimJoseph
...............................................
Publisher:Sams
PubDate:March22,2006
PrintISBN-10:0-672-32799-6
PrintISBN-13:978-0-672-32799-5
Pages:480
TableofContents|Index
SQLServerReportingenablesthecreation,management,anddeliveryofbothtraditional,
paper-orientedreportsandinteractive,Web-basedreports.Anintegratedpartofthe
Microsoftbusinessintelligenceframework,ReportingServicescombinesthedata
managementcapabilitiesofSQLServerandMicrosoftWindowsServerwithfamiliarand
powerfulMicrosoftOfficeSystemapplicationstodeliverreal-timeinformationtosupport
dailyoperationsanddrivedecisions.MicrosoftSQLServer2005ReportingServiceswill
helpyouunderstandReportingServicesfromvariousperspectives:
Howitfitsbusinessscenarios
HowtoinstallandconfigureReportingServices
ReportingServicescomponents
Developingreports
Asyouprogresstoadvanceduserstatus,youwillenjoythechapteraboutaccessing
ReportingServicesprogrammaticallyandextendingReportingServices,andyouwillbe
abletousethisbookasaconvenientreference.
Microsoft®SQLServer2005ReportingServices
ByMichaelLisin,JimJoseph
...............................................
Publisher:Sams
PubDate:March22,2006
PrintISBN-10:0-672-32799-6
PrintISBN-13:978-0-672-32799-5
Pages:480
TableofContents|Index
Copyright
AbouttheAuthors
Acknowledgments
WeWanttoHearfromYou!
Introduction
PartI:IntroductiontoReportingServices
Chapter1.IntroductiontoSQLServerReportingServices(SSRS)
WhatIsSSRS?
SSRSforEndUsers
OverviewofFeatures
EnterpriseReportExamples
SSRSintheReportDevelopmentLifeCycle
EditionsofReportingServices
HowIsSSRSLicensed?
Summary
Chapter2.ReportingServicesCapabilities:Presentation,Navigation,and
Programmability
ReportLayouts
ReportPresentation(Rendering)Formats
ReportItems,VisualEffects,andCharting
ReportNavigation
AdHocReportsNEWin2005
ReportingServicesDataAccessFeatures
Programmability
Summary
Chapter3.ReportingServicesArchitecture
ReportServerWebandWindowsService
ProgrammaticInterfaces
ReportProcessor
Command-LineUtilities
ReportingServicesExtensions
ReportServerDatabases
SchedulingandDeliveryProcessor
ReportBuilderNEWin2005
ReportModelDesignerNEWin2005
ReportDesigner
ReportManager
SQLServerManagementStudioNEWin2005
ReportingServicesConfigurationToolNEWin2005
RSPrintClientControlNEWin2005
WMIProvider
PerformanceMonitoringObjects
Summary
Chapter4.ReportingServicesDeploymentScenarios
High-AvailabilityDeploymentConsiderations
InternetDeploymentConsiderations
MinimumHardwareRequirements
SoftwareRequirements
KeyFeaturesofSSRSbySQLServer2005Editions
Licensing
Summary
Chapter5.InstallingReportingServices
Summary
PartII:ReportAuthoringfromBasictoAdvanced
Chapter6.ReportDesigner
TwoMainReportDesignersfromMicrosoft
VisualStudioHavesVersusHaveNots
Solution,Project,FileHierarchy
GeneratingReportswithVisualStudio
Summary
Chapter7.ReportDefinitionLanguage
Language:AWaytoCommunicate
UseofXML
DeclarativeProgramming
ReportElements
Summary
Chapter8.Expressions
WhatIsanExpression?
ExpressionSyntax
AddingExpressions
Collections
UsingFunctions
OtherFunctions
UsingExpressionstoChangeReportItemPropertiesandBehavior
Example:PlacingEmphasisonCertainValues
Summary
Chapter9.AccessingData
Data-ProcessingExtensions
TypesofDataSources
ConnectionStrings
QueryingData
AddingaDataSource
Summary
Chapter10.ReportParameters
SettingUpParameters
ParameterProperties
Data-DrivenParameters
ParametersandDataSources
ExpressionswithParameters
DynamicSQLwithParameters
ParameterDependencies
ExampleUsingMultiValueNEWin2005
Summary
Chapter11.WorkingwithReportItems
DataRegions,Containers,andIndependentReportItems
ReportDesigner'sToolbox
LineReportItem
RectangleReportItem
ImageReportItem
TextboxReportItem
TableReportItem
ListReportItem
PracticalApplicationofReportItems
MatrixReportItem
ChartReportItem
ChartData(Value)
ChartSeriesGroups
ChartCategoryGroups
Chart'sRDL
PracticalApplicationofChartandMatrix
ReportBodyVersusPageHeader/Footer
Summary
Chapter12.Grouping,Sorting,andAggregatingData,WorkingwithScope
GroupingDataonaReport
Sorting,IncludingInteractiveUserSorting
InteractiveSortingNEWin2005
DataSourceSorting
DataRegionandGroupSorting
ScopeofanAggregateFunction
LevelandInScopeFunctions
Summary
Chapter13.AdvancedReportFormatting
Formatting-RelatedReportItemProperties
FormattingNumericandDate/TimeValues
StandardDate/TimeFormatStrings
CustomDate/TimeFormatting
CreatingAlternatingColorsfortheLinesonaReport
PagingReport
Summary
Chapter14.ReportNavigation
Hyperlink(JumptoURL)Navigation
BookmarkLink(JumptoBookmark)Navigation
DocumentMap
Drillthrough(JumptoReport)Navigation
HidingItemsandToggleItems
PracticalApplicationofActionItems
Summary
Chapter15.WorkingwithMultidimensionalDataSources
AnalysisServicesConcepts
Data-MiningConcepts
Summary
Chapter16.AdHocReportingNewin2005
IssuesFacingAdHocReporting
Client-sideReportingwithSSRS
ReportModelsandtheModelDesigner
ReportModelProjects
ModelFileContent
FeaturesofReportBuilder
BuildingReportswithReportBuilder
Summary
PartIII:ReportingServicesAdministrationandOperations
Chapter17.ManagingReports,DataSources,andModels
DeploymentOptionsinVisualStudio
DeploymentThroughReportManager
DeployingReportsThroughSQLServerManagementStudio
ChangingReportProperties
SettingReportHistoryandSnapshots
MyReports
Summary
Chapter18.SecuringReportServerItems
ReportingServicesSecurityModel
WhatCanBeSecured?
HowRoleAssignmentsWork
RelationshipsBetweenRoles,Tasks,andUsers
OverviewofBuilt-InRoles
AssigningBuilt-InRoles
DefiningCustomRoles
Summary
Chapter19.SubscribingtoReports
OverviewofSubscriptions
OverviewofDeliveryExtensions
CreatingaSimpleSubscription
CreatingaData-DrivenSubscription
ManagingSubscriptions
Summary
Chapter20.ReportExecutionandProcessing
ManagingSchedules
ReportExecutionandProcessing
ReportExecutionHistory
Summary
Chapter21.DeployingandConfiguringSSRS
OverviewofDeploymentScenarios
RequirementsforaStandardDeployment
RequirementsforaScale-OutDeployment
ConfiguringSSRS
KeyManagement
Summary
PartIV:DevelopingforReportingServices
Chapter22.ImplementingCustomEmbeddedFunctions
AddingEmbeddedCode
DebuggingEmbeddedCode
Summary
Chapter23.HowtoCreateandCallaCustomAssemblyfromaReport
Strong-NamedCustomAssemblies
NETSecurityPrimerforaSSRSAdministrator
AssembliesThatRequireOtherThanExecutePermissions
DebuggingCustomAssemblies
Summary
Chapter24.HowtoIntegrateURLAccess
HowtoIntegrateURLAccessinanApplication
Summary
Chapter25.HowtoUseReportingServicesWebServices
ReportManagementWebServiceNewin2005(ReportService2005.asmx)
HowtoScriptReportingServices(UsingtheRSUtility)
WorkingwithReportParameters
SecurityWhenCallingaWebService
SomeoftheCommonlyUsedMethodswithShortCodeSnippets
Summary
Chapter26.WritingCustomReportingServicesExtensions
CommonConsiderationsforCustomReportingServicesExtensions:
Implementation,Deployment,andSecurity
DeliveryExtension
InteractionsBetweenUser,SSRS,andaDeliveryExtension
Summary
Chapter27.ReportRenderingControlsandSharePointServicesWebParts
MicrosoftVisualStudio2005ReportViewerWebandWindowsControlsNewin
2005
MicrosoftSharePointWebParts
Summary
Chapter28.CustomReportDefinitionLanguage(RDL)Generatorsand
CustomizingReportDefinition
Summary
PartV:Appendices
AppendixA.ReferencesandAdditionalReading
AppendixB.Glossary
AppendixC.FAQ
Index
Copyright
Microsoft®SQLServer2005ReportingServices
Copyright©2006bySamsPublishing
Allrightsreserved.Nopartofthisbookshallbereproduced,
storedinaretrievalsystem,ortransmittedbyanymeans,
electronic,mechanical,photocopying,recording,orotherwise,
withoutwrittenpermissionfromthepublisher.Nopatent
liabilityisassumedwithrespecttotheuseoftheinformation
containedherein.Althougheveryprecautionhasbeentakenin
thepreparationofthisbook,thepublisherandauthorassume
noresponsibilityforerrorsoromissions.Norisanyliability
assumedfordamagesresultingfromtheuseoftheinformation
containedherein.
LibraryofCongressCatalogCardNumber:2005937212
PrintedintheUnitedStatesofAmerica
FirstPrinting:March2006
080706054321
Trademarks
Alltermsmentionedinthisbookthatareknowntobe
trademarksorservicemarkshavebeenappropriately
capitalized.SamsPublishingcannotattesttotheaccuracyof
thisinformation.Useofaterminthisbookshouldnotbe
regardedasaffectingthevalidityofanytrademarkorservice
mark.
WarningandDisclaimer
Everyefforthasbeenmadetomakethisbookascompleteand
asaccurateaspossible,butnowarrantyorfitnessisimplied.
Theinformationprovidedisonan"asis"basis.Theauthor(s)
andthepublishershallhaveneitherliabilitynorresponsibilityto
anypersonorentitywithrespecttoanylossordamagesarising
fromtheinformationcontainedinthisbook.
BulkSales
SamsPublishingoffersexcellentdiscountsonthisbookwhen
orderedinquantityforbulkpurchasesorspecialsales.For
moreinformation,pleasecontact
U.S.CorporateandGovernmentSales
1-800-382-3419
ForsalesoutsideoftheU.S.,pleasecontact
InternationalSales
Publisher
PaulBoger
AcquisitionsEditor
NeilRowe
DevelopmentEditor
MarkRenfrow
ManagingEditor
CharlotteClapp
ProjectEditor
GeorgeNedeff
CopyEditor
KarenAnnett
Indexer
KenJohnson
Proofreader
KathyBidwell
TechnicalEditor
J.BoydNolan
PublishingCoordinator
CindyTeeters
InteriorDesigner
GaryAdair
CoverDesigner
GaryAdair
PageLayout
NonieRatcliff
Dedication
MichaelLisin:Dedicatedtomyfamily:mywifeAnna,my
daughterHelen,mymother,andthememoryofmy
grandfather.Thankyouforalwaysbeingextremelysupportive
inmylifeendeavors.
JimJoseph:DedicatedtomywifeDeseereandmyson
Christopher.
AbouttheAuthors
MichaelLisinhasbeeninthesoftwareindustryformorethan
14yearswith7ofthoseyearsworkingwithMicrosoft.Heis
currentlyworkingasaseniorstrategyconsultantwithMicrosoft
ConsultingServices.MichaelhasbeenworkingwithSQLServer
forsixyearsandwithSQLServerReportingServicesstarting
fromthepre-Betaversionin2002.Michaelhastaught
ReportingServicesclassesandpresentedSQLServer-related
topicsduringvariousevents.MichaelwillcompletehisMBA
degreeatTexasA&Mthisyear.
JimJosephisamanageratContinentalAirlinesInc.He
currentlyfunctionsasaSQLServerDBAwithintheFinancial
SystemsGroupwithContinentalTechnology.HeearnedhisMBA
attheUniversityofStThomasin2003,andundergraduate
degreeinmathematicsfromtherein1999.Inhissparetime,
heenjoysspendingtimewithhisinfantson,Christopher,and
wifeDeseere.
Acknowledgments
Theauthorswouldliketothankthepublishingteamworking
withusonthisbook.Specialthanksto:Neil,Mark,George,
Karen,andAlex.Thankyouforyourvaluablefeedback,
answers,andhardworkonthisbook.Withoutyouall,thisbook
wouldnotbecomplete.
ThankyoutoBrianWelcker,RichardWaymire,RobertBruckner,
ThierryD'Hers,DavidCrawford,BogdanCrivat,DonovanSmith,
andEliIlionskyforhelpingwithquestionsthatarosewhile
writingthisbook.ThankyoutoMattWhittenandStephen
RauchforgettingMichaelstartedwithReportingServices.
ThankyoutoKevinSwalesforpointersaboutexceptionreports.
WeWanttoHearfromYou!
Asthereaderofthisbook,youareourmostimportantcritic
andcommentator.Wevalueyouropinionandwanttoknow
whatwe'redoingright,whatwecoulddobetter,whatareas
you'dliketoseeuspublishin,andanyotherwordsofwisdom
you'rewillingtopassourway.
AsanassociatepublisherforSamsPublishing,Iwelcomeyour
comments.Youcanemailorwritemedirectlytoletmeknow
whatyoudidordidn'tlikeaboutthisbookaswellaswhatwe
candotomakeourbooksbetter.
PleasenotethatIcannothelpyouwithtechnicalproblems
relatedtothetopicofthisbook.WedohaveaUserServices
group,however,whereIwillforwardspecifictechnicalquestions
relatedtothebook.
Whenyouwrite,pleasebesuretoincludethisbook'stitleand
authoraswellasyourname,emailaddress,andphonenumber.
Iwillcarefullyreviewyourcommentsandsharethemwiththe
authorandeditorswhoworkedonthebook.
Email:
Mail:Paul
BogerPublisher
SamsPublishing
800East96thStreet
Indianapolis,IN46240USA
FormoreinformationaboutthisbookoranotherSams
Publishingtitle,visitourwebsiteatwww.samspublishing.com.
TypetheISBN(excludinghyphens)orthetitleofabookinthe
Searchfieldtofindthepageyou'relookingfor.
Introduction
SQLServerReportingServicesisaserver-based,extensibleand
scalableplatformthatdeliversandpresentsinformationbased
ondatathatabusinesscollectsduringitsoperation.
Information,inturn,helpsbusinessmanagerstoevaluatethe
currentstateoftheenterpriseandmakedecisionsonhowto
increaserevenues,reducecosts,andincreasecustomerand
employeesatisfaction.
TheReportingServicesscopeextendsfromtraditionalpaper
reportstointeractivecontentandvariousformsofdelivery:
email,fileshares,andsoon.SSRSiscapableofgenerating
reportsinvariousformats,suchasHypertextMarkupLanguage
(HTML),ExtensibleMarkupLanguage(XML),andExcelformats,
thusallowinguserstomanipulatetheirdatainwhateverformat
isrequired.
Beforedivingintothisbook,let'stakeamomenttounderstand
thelayoutaswellassomeoftheconventionsusedinthebook.
First,wecoverhowthisbookisorganizedandwhatyoucan
expectineachsection.Second,wecoverthestyleand
formattingconventionsusedinthisbook.Itisparticularly
noteworthytonotethestylechangesinreferencetocodelines,
includingSQLServerand.NETcode.
HowThisBookIsOrganized
ThisbookbeginswithanintroductoryoverviewofSQLServer
2005ReportingServicesandcoversabroadrangeoftopicsin
theareasofreportauthoring,ReportingServicesdeployment
andadministration,andcustomcodedevelopmentforReporting
Services.
ThechaptersinPartI,"IntroductiontoReportingServices,"
provideahigh-leveloverviewofReportingServicesand
highlightkeyfeaturesoftheReportingServices,deployment
scenarios,typicalusersofReportingServices,andReporting
Servicesarchitecture.Thispartallowsforleisurelyreadingand
doesnotrequireyoutohaveaccesstoacomputer.
ThechaptersinPartII,"ReportAuthoringfromBasicto
Advanced,"takeyouthroughreportdevelopmenttoolsand
processes.Thispartdescribesreportbuildingblocksandwalks
throughbuildingareportfromsimpletocomplex.
ThechaptersinPartIII,"ReportingServicesAdministrationand
Operations,"discussadvancedtopicsofReportingServices
administration,suchassettingpropersecurity,managing
ReportingServicesasindividualserversandinawebfarm,and
gatheringreportexecutioninformation.
ThechaptersinPartIV,"DevelopingforReportingServices,"
areforthoseofyouwhomightwanttoextendReporting
Servicesandincorporatereportsintheirapplications.Thispart
coverskeyprogrammableaspectsofReportingServices.
ConventionsUsedinThisBook
SQLServer2005ReportingServicesisfrequentlyabbreviated
asSSRS.
BusinessIntelligenceDevelopmentStudioisfrequently
abbreviatedasBIDS.
NewfeaturesavailableinSQLServer2005ReportingServices
ascomparedtoSQLServer2000ReportingServices(SSRS2K)
arelabeledwith"NEWin2005".
Namesofproducts,tools,individualwindows(dockingornot),
titles,andabbreviationsarecapitalized.Forexample,SQL
Server2005,SQLServerReportingServices,VisualStudio
2005,ReportDesigner,ReportBuilder,ReportManager,
Windows,andsoon.
Monospaceisusedtohighlight:
Sectionsofcodethatareincludedintheflowofthe
text"Addatextboxtoareportandplacethefollowingcode
intheBackgroundColorproperty:=Code.Highlight(value)."
Filenames"VisualStudiocreatesaprojectwithasingleclass
Class1.Let'srenamefileClass1.csinSolutionExplorerto
MainClass.cs."
Pathnames"Thecompiledassemblymustbelocatedin
directorieswhereitisaccessiblebyReportDesigner(the
defaultdirectoryisC:\ProgramFiles\MicrosoftVisualStudio
8\Common7\IDE\PrivateAssemblies)andSSRS(defaultisC:\Program
Files\MicrosoftSQLServer\MSSQL.3\Reporting
Services\ReportServer\bin)."
Errornumbers,codes,andmessages:"
[rsInvalidReportParameterDependency]Thereportparameter
'SalesOrderId'hasaDefaultValueoraValidValuethatdependson
thereportparameter"MaxOrderId".Forwarddependenciesarenot
valid."
Namesofpermissions,constants,properties,collections,
andvariables:Execute,Fields,ReportParameter,Parent.
Toindicateadjustableinformation,weuse
"{}",mostlywherethevariableinformationcanbe
confusedwithXML,forexample<Value>{EXPRESSION}</Value>.In
thisexample,an{EXPRESSION}isanyvalidexpression,
suchas=Fields!ProductImage.Value.
"<>",wherethevariableinformationcannotbeconfused
withXML,forexample=Fields!<FieldName>.Value.
PartI:IntroductiontoReportingServices
InThisPart
CHAPTER1IntroductiontoSQLServerReportingServices
(SSRS)
CHAPTER2ReportingServicesCapabilities:Presentation,
Navigation,andProgrammability
CHAPTER3ReportingServicesArchitecture
CHAPTER4ReportingServicesDeploymentScenarios
CHAPTER5InstallingReportingServices
Chapter1.IntroductiontoSQLServer
ReportingServices(SSRS)
InThisChapter
WhatIsSSRS?
SSRSforEndUsers
OverviewofFeatures
EnterpriseReportExamples
SSRSintheReportDevelopmentLifeCycle
EditionsofReportingServices
HowIsSSRSLicensed?
Note
ThisbookabbreviatesSQLServer2005
ReportingServicesasSSRSandSQLServer
2000ReportingServicesasSSRS2K.New
featuresavailableinSSRSandnotinSSRS2K
arelabeledwith"NEWin2005".
Intoday'sultracompetitivebusinessenvironment,havinggood
informationisessential.Companiesareawashininformation,
andwiththeadventoftechnologiessuchasRFID,moreand
moreinformationiscoming.Technologyhasmadethejobof
gatheringinformationtrivial,butmakingsenseofitallstill
remainselusive.Thismakesgoodreportingandbusiness
intelligencetoolsessential.
Thisfirstchapterisstrictlynontechnical.Thischapterfocuses
onthefollowing:
CapabilitiesofSSRS
HowitfitsintotheMicrosoftBusinessIntelligenceplatform
ReportdevelopmentlifecycleasitrelatestoSSRS
EditionsofSSRS
LicensingSSRS
WhatIsSSRS?
SSRSisMicrosoft'sanswertobusinessreporting.Itprovidesa
unified,server-based,extensible,andscalableplatformfrom
whichtodeliverandpresentinformation.Itsscopeextends
fromtraditionalpaperreports,toweb-baseddeliveryand
interactivecontent.SSRScanalsobeconfiguredtodeliver
reportstopeoples'inboxes,fileshares,andsoon.SSRSis
capableofgeneratingreportsinvariousformats,suchasthe
web-orientedHypertextMarkupLanguage(HTML)anddesktop
application(MicrosoftExcelandCSV)formats,thusallowing
userstomanipulatetheirdatainwhateverformatisrequired.
SSRSisjustoneofthecomponentsintheMicrosoftBusiness
Intelligence(BI)platform.Combined,thosecomponents
provideanexcellentplatformforenterprisedataanalysis.The
MicrosoftBIplatformincludesthefollowing:
SQLServerThetraditionaldatabaseengine,whichalso
storesSSRS'catalogdata.
SQLServerAnalysisServices(SSAS)Acomponentfor
onlineanalyticalprocessing(OLAP)anddatamining.OLAP
performsdataaggregationandallowsuserstotraverse
fromaggregationstodetailslookingthoughthedimensions
(suchasgeographyortime)ofdata.Datamininghelps
userstodiscoverpatternsindata.
SQLServerIntegrationServices(SSIS)Acomponent
forextracting,transforming,andloading(ETL)data.
SQLServerNotificationServices(SSNS)Acomponent
fordeployingandsendingnotificationsofchangingdata.
SSRSforEndUsers
SSRSisuniqueintheMicrosoftBusinessIntelligencesuite,asit
coversavarietyofinformationusers.Microsoftdividesusers
intothreegroups:informationconsumers,information
explorers,andanalysts.
Table1.1brieflysummarizesthepercentagesofusersineach
group,theleveloftechnicalexperience,andtheexpectations
fromanenterprisereportingtool.Allofthesefactorswillvary
fromcompanytocompany,butgenerallythebreakdownholds
true.
Table1.1.BreakdownofInformationWorkers
Typeof
User
Percentage
Technical
Expertise
Analysts
5%-10%
High
Analystscandevelop
reports,workwithadhoc
reports,andperform
sophisticatedcalculations
(suchaslinearregressions
andtrendanalysis).
Analystsoftenpublish
reportstoexplorersand
consumers.
Information
explorers
15%-30%
Medium
Informationexplorerswant
tointeractwithreportsto
somedegree,suchas
applyingfiltersor
performingdrilldown
through.
Information
consumers
55%-85%
Low
Informationconsumersuse
static,predefined,and
preformattedreports.
Expectation