Database Reference
In-Depth Information
Listing 19-6. Executing the SSIS Package to Restore an SSAS Database
CD C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn
DtExec.exe /FILE \\RSLAPTOP2\PubsBIProdFiles\RestorePubsBICubes.dtsx
Deploying the SSRS Reports
Once again, your choices are to manually deploy the report files to the SSRS web service or to automate the
deployment using a command prompt utility. The SSRS reports can be deployed to the web service using a utility
called RS.exe . Unfortunately, it is the least friendly of the deployment options. The utility requires that you create
a VB .NET file that tells the web services what to do. This code is placed in a file with an .rss extension. For
instance, code used to deploy a report from the network share to Randal's SSRS server looks like the code shown
in Listing 19-7.
Listing 19-7. Code to Place in an .rss File to Upload an SSRS Report
' Deploy SSRS Report from a Command Line:
' RS.exe -i deploy_report.rss -s http://rslaptop2/ReportServer_SQL2012/ReportServer
'
Dim strPath = "\\RSLAPTOP2\PubsBIProdFiles\"
Dim strReportName = "SalesByTitles"
Dim strWebSiteFolder = "/PubsBIReport"
Dim arrRDLCode As [Byte]() = Nothing
Dim arrWarnings As Warning() = Nothing
Public Sub Main()
Try
'Read the RDL code out of the file.
Dim stream As FileStream = File.OpenRead(strPath + strReportName + ".rdl")
arrRDLCode = New [Byte](stream.Length) {}
stream.Read(arrRDLCode, 0, CInt(stream.Length))
stream.Close()
'Upload the RDL code to the Web Service
arrWarnings = rs.CreateReport(strReportName, strWebSiteFolder, True, arrRDLCode, Nothing)
If Not (arrWarnings Is Nothing) Then
Dim objWarning As Warning
For Each objWarning In arrWarnings
Console.WriteLine(objWarning.Message)
Next objWarning
Else
Console.WriteLine("Report: {0} published successfully with no warnings", REPORT)
End If
Catch e As IOException
Console.WriteLine(e.Message)
End Try
End Sub
After you have created the .rss file, execute it with the RS.exe command prompt code as shown in
Listing 19-8. This, too, can be placed in the same batch file that deploys the data warehouse, ETL package, and SSAS
database.
 
Search WWH ::




Custom Search