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
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.|||As long as you've also uploaded the data source that the DSV in your model uses, just upload the model (smdl) and you'll be fine.|||Thanks Russell.That makes sense.
one more question on this one ,i'll upload data source also thats no problem but how can i change connection string easily. as you know sql server names can be different. we've no of client sites where we need to deploy our reporting models. our database name will be same but as you know server names can be different with each site.
can connection string be taken from a config file ?
Thanks for your help|||You can set the connection string for the model manually in Report Manager (or Management Studio). Bring up the model properties and go to the datasource tabs. If you want to do it programmatically / through script, you will want to call SetItemDataSources (http://msdn2.microsoft.com/en-us/library/ms160404(en-US,SQL.90).aspx).|||Thanks Brian
Will give it a try mate|||
Russell Christopher - msft wrote:
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
Russel, Why cant i find "Export " option on report manager page ? or am i missing something ?
anyway i managaed to find .smdl file on my machine (where i created the report model) and on production server i used "upload File" to import my report model and it worked fine and users could create reports fine.
but today i changed report model as users needed few more entities and i tried to deploy again the updated report model with same steps as above. But all existing reports created prior to this stopped working!! i get runtime errors.. but users can create new ones though.
am i doing anything wrong ?
Thanks for your help again. am still trying to get my head around on deploy issues.|||
"Export" is actually labeled "Edit" in Report Manager. It's a very small hyperlink on the General property tab of your report.
I'm not exactly sure why the previously published reports stopped working. Did they work after you reset the data source for each report?
|||Thank you very much Russellfinally i successfully did "export" at client machine.it worked nicely.Thanks you so much for you help on this .
BTW the other issue (ie, previous reports not working) i'll need to do little more testing and i'll see what happens if change report model and re-deploy again on the same client machine.|||
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
|||FileStream stream = File.OpenRead(@."c:\MyReport.smdl");
definition = new Byte[stream.Length];
stream.Read(definition, 0, (int) stream.Length);
stream.Close();
//Now use CreateModel with "defintion" variable
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
No comments:
Post a Comment