deploying report models
Hi Friends
I've quick question ,we have a .net application and we want develop a report builder utility for our end users.I found sql server's built in Report builder is very useful so i created a report model which is easy enough for our end users to select different data items to create their own reports.
My questions is how can i deploy this from our production machine to client site ?what are the requirements etc.,
I have looked web for any references but in vain.
Any help with this regard is much appreciated.
Thank you
[549 byte] By [
prk] at [2007-12-17]
Hi --
There are a number of ways to accomplish this:
First, export the model definition (smdl) from the production server using Report Manager.
Then:
- You can bring it to the client site and directly upload it via Report Manager
- You can use the CreateModel() method of the ReportingService2005 web service to programmatically create the model after you load the smdl into an array of bytes
Note that a deployed model contains the DSV definition it is based on inside the smdl document itself. Until you deploy it, the DSV is *not* “plugged” into the smdl file, however….So don’t just create a model using the Model Designer, and then expect to be able to take the resulting smdl and bring it to the client site. You must first deploy it in order to get Visual Studio to merge the DSV into a complete smdl document.
Thank you very much Russell.
I understand export and upload options you mentioned but i did not understand your 2nd point. ie
>>You can use the CreateModel() method of the ReportingService2005 web service to programmatically create the model after you load the smdl into an array of bytes
so does it mean that uploading SMDL file at the site will not be enough ,will it?
Thanks for your help on this. I really appreciate if you have some sample code or some links abt these deploying issues.
I looked MS help but they just talk abt deploy option from solution explorer and they dont talk abt deploying on completly different machine.
prk at 2007-10-6 >

Russell,
I'd like some more information on your point 2, using the CreateModel() method. I know how to reference the ReportingServices2005 web service, and then instantiate it's class. Then I can do (for instance) rs.CreateModel(), but how do I load the smdl into an array of bytes? I've not done that. Do you have an online resource that can explain this process?
And I know that you can use Report Viewer in Visual Studio to avoid sending a user to a report server to view reports. Is this also an option with ad hoc reports? If I use the BI to create a Report Model, and then export it, can I now direct our users to a web page/site that I create (that I can have more control over) in order to avoid sending them to the Report Server?
Thanks in advance.
Marvin Hoffman
Hi,
This is what i came up with while searching for a way to create model programaticaly.
Uploading a Report Model
Dim DataSourceName As String = "/Adventure Works"
Dim ModelName As String = "/Adventure Works Model"
Dim MyServer As String = "MyReportServer"
Dim rs As New ReportingService2005
rs.Url = "http://" + MyServer + "/reportserver/reportservice2005.asmx"
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim props = Nothing
Dim modelPath As String = "./Adventure Works Model.smdl"
Dim fs As FileStream
fs = File.OpenRead(modelPath)
Dim modelDefinition As Byte() = New [Byte](fs.Length) {}
fs.Read(modelDefinition, 0, CInt(fs.Length))
fs.Close()
Try
rs.CreateModel("Adventure Works Model", "/", modelDefinition, props)
Catch e As SoapException
Console.WriteLine("Error : " + e.Detail.Item("ErrorCode").InnerText +
" (" + e.Detail.Item("Message").InnerText + ")")
End Try
Creating Data Source
Dim dsDefinition As New DataSourceDefinition
dsDefinition.Extension = "OLEDB-MD"
dsDefinition.CredentialRetrieval = CredentialRetrievalEnum.Integrated
dsDefinition.ConnectString = "data source=" + MyServer + ";initial catalog=Adventure Works DW"
dsDefinition.ImpersonateUserSpecified = True
dsDefinition.Enabled = True
dsDefinition.EnabledSpecified = True
Try
rs.CreateDataSource("Adventure Works", "/", False, dsDefinition, props)
Catch e As SoapException
Console.WriteLine("Error : " + e.Detail.Item("ErrorCode").InnerText +
" (" + e.Detail.Item("Message").InnerText + ")")
End Try
Associating Report Model with Data Source
Dim ds() As DataSource
ds = rs.GetItemDataSources(ModelName)
Dim dsref As New DataSourceReference
dsref.Reference = DataSourceName
ds(0).Item = dsref
Try
rs.SetItemDataSources("/Adventure Works Model", ds)
Catch e As SoapException
Console.WriteLine("Error : " + e.Detail.Item("ErrorCode").InnerText +
" (" + e.Detail.Item("Message").InnerText + ")")
End Try