Tải bản đầy đủ - 0 (trang)
Chapter 17. Managing Reports, Data Sources, and Models

Chapter 17. Managing Reports, Data Sources, and Models

Tải bản đầy đủ - 0trang

DeploymentOptionsinVisualStudio

BecauseVisualStudioistheprimaryreportdevelopmenttool,it

shouldcomeasnosurprisethatithasthecapabilitytodeploy

reports.Youcanactuallysetituptodeployreportseverytime

youbuildyourprojects.Inaddition,youcanuseVisualStudio

tooverwriteexistingdatasourcesontheserver,hencesetting

theproperlocationforuseinproduction.



ServerName

First,youneedtosettheservernamefordeploymentofyour

project.Youcandothisbysettingtheprojectproperties

throughtheIDE.Thisisactuallymuchsimplerthanitsounds.If

youhaveclosedtheAdventureWorksReportsSamplesreports

project,openitagain.

1. OpenSolutionExplorer(View,SolutionExplorer).

2. 2.Right-clickontheprojectandselectProperties.

3. YoushouldhaveascreenthatlookssimilartoFigure17.1.



Figure17.1.Deploymentpropertiesforthe

AdventureWorksproject.

[Viewfullsizeimage]



Nowallyouhavetodoissettheservername.Theservername

andvirtualdirectoryhavetobeplacedintheTargetServerURL

property.Theformatishttp://{ServerName}/{VirtualDirectory}.By

default,ifyouhaveinstalledtheserverlocally,itspropertyis

filledinashttp://localhost/ReportServer



ReportFolderLocation

TargetReportFolderisanothermajorproperty.

Bydefault,itsetsitselftotheprojectname.Thefoldernameis

thenameofthefoldercreatedontheReportServertohouse

yourreports.Youcanleaveitblankandreportswilldeployon

therootfolder.



OverwritingDataSources



OneofthemostimportantpropertiesisOverwriteDataSource

asitwillchangethelocationofthedatasourceontheReport

Server.

Bydefault,whenVisualStudiodeploys,itcreatesthedata

sourceforyourreports.Thekeyhereisitcreatesthedata

source,butneverupdatesitevenifyouhaveupdatedthedata

sourceinyourproject.Theexceptiontothisiswhenthereport

hasanembeddeddatasourceinitsdatasets.

Thepurposeofthisswitchistoforcetheupgradeofshared

datasources.Ifyouneedtooverwritethedatasources,setthis

totrue,andyouwillbeonyourway.



TargetFolderforDataSourceNEWin1005

Thisproperty(TargetDataSourceFolder)issimilartothefolder

forreports.ThisisactuallynewinSSRS2005.Theprevious

versionhadnosuchoption.Rememberthisonlyappliesto

shareddatasources.



BuildingandDeployingReports

Whenyousetalltheproperties,youshouldhaveascreenthat

lookssimilartoFigure17.2.



Figure17.2.Completeddeploymentpropertiesfor

theAdventureWorksproject.



[Viewfullsizeimage]



Whenyouarereadytodeploythereportsanddatasources,

completethefollowingsteps:

1. FromSolutionExplorer,right-clickontheproject.

2. SelectDeploy.



AfteraquickpermissionscheckwiththechosenReportServer,

VisualStudioshouldallowyoutodeploytheproject.Atthis

point,youshouldseethefolderscreatedinReportManager.

SeeFigure17.3.



Figure17.3.DeployedAdventureWorksproject.



[Viewfullsizeimage]



DeploymentThroughReportManager

AscoveredinChapter1,"IntroductiontoSQLServerReporting

Services(SSRS),"theReportManagerwebapplicationisthe

mainuserinterface.Alladministrativefunctionscanbecalled

fromhere.Italsoservesasthemainuserinterfaceintothe

ReportServer.Essentially,itchecksuserpermissions,andifyou

havepermissiontodoatask,itpresentsyouwiththeinterface

todoit.Bydefault,administratorsonthemachineonwhichthe

ReportServerisinstalledhavefullpermissionstoallfunctions.



CreatingaNewFolder

First,youneedtosetupafolderintowhichyouwilldeploythe

reports.Ifyouwant,youcandeployitontotherootofthe

ReportServer;however,itcangetdifficulttomanagewitha

largenumberofreports.

IntheReportManageruserinterface,arowofbuttonsdisplays

acrossthetop.SeeFigure17.4.



Figure17.4.Creatinganewfolder.



[Viewfullsizeimage]



TogetacquaintedwithReportManager,let'suseittopublish

somereportsmanually.Thefirstthingtodoistocreateanew

folderbyclickingontheNewFolderbutton.Youshouldseea

screensimilartoFigure17.4.

Completethefollowingstepstofinishaddingthenewfolder:

1. ChangetheNamefieldtoAdventureWorksReports.

2. ChangetheDescriptionfieldtoReportsforAdventureWorks

Inc.

3. ClickOK.



Thisshouldreturnyoutothemainscreen,andyoushouldsee

yourfolderpresent.Ifyouclickonthefolder,theuserinterface

showsyouitscontents;however,itwillbeemptybecauseit



wasjustcreatedandyouhaven'tpublishedanythingyet.



SettingUpaDataSource

Itistimetosetupashareddatasourceforthereportthatyou

willbepublishing.Theshareddatasourceisbeneficialbecause

youhavemanyreportsthatusethesamedatabasecatalogfor

information.Tosetupashareddatasource,performthe

followingsteps:

1. Ifyouhaven'tdonesoalready,clicktheAdventureWorks

Reportsfolder.

2. ClicktheNewDataSourcebuttononthetoolbar.The

contentsofthebrowserwindowshouldlooksimilartoFigure

17.5.



Figure17.5.Creatinganewdatasource.

[Viewfullsizeimage]



3. IntheNametextbox,enterAdventureWorksDataSource.

4. IntheDescriptionfield,enter"Connectstothe

AdventureWorksdatabaseonthelocalSQLServerinstance."

5. SelectMicrosoftSQLServerfortheconnectiontype.

6. Enterthefollowingconnectionstring:Data

Source=localhost;InitialCatalog=AdventureWorks.



7. SelectWindowsIntegratedSecurity.

8. ClickOK.



ClickingtheOKbuttonshouldreturnyoutothefoldercontents

andyourdatasourceshouldbedisplayed.



UploadingaReport

Nowitisfinallytimetouploadyourreports.Thisisapretty

straightforwardprocess,butyouneedtoknowthelocationof

theRDLfilesonyourharddrive.Ifyoudonotremember,go

backtotheVisualStudiosolution,clickonthereportinside

SolutionExplorerandlookatthepropertiesforthereportlist.

TakenoteoftheFullPathproperty.Thisisthelocationofthe

RDLfileonyourPC.

Let'scontinueonandusetheReportManagertouploadour

reports.Touploadreports,performthefollowingsteps:

1. ClicktheUploadFilebuttononthetoolbar.

2. ClickBrowseandbrowsetothelocationoftheRDLfile.

3. ChangetheNameproperty.SeeFigure17.6.



Figure17.6.Uploadingafilefromthe

AdventureWorksproject.

[Viewfullsizeimage]



4. Ifyouwanttoupdateanexistingcopyofthereport,check

theOverwriteItemifItExistscheckbox.

5. ClickOK.



ReportManagershouldnowdisplaythefoldercontentswiththe

reportanddatasourceinit.



ChangingtheReportManDataSource

Becauseyouareusingashareddatasource,itmakessenseto

changethereporttousetheshareddatasource.Changingthe

reporttousetheshareddatasourceentailsthefollowingsteps:

1. Clickonthereport.

2. ClickthePropertiestab.



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Chapter 17. Managing Reports, Data Sources, and Models

Tải bản đầy đủ ngay(0 tr)

×