Howto upload programaticaly SMDL file&

Hi.
I need upload smdl file in setup. Howto do it?
[60 byte] By [DmitriySaikovkiy] at [2007-12-16]
# 1
You need to call the CreateModel method on the ReportingService2005 SOAP endpoint.
BrianWelcker-MS at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 2
Earlier, if you wanted to deploy a report file (*.rdl), you just need to go to Report Manager, and upload the *.rdl file.

Things wont work like that with model files (*.smdl). If you try to just upload a model file, you will get the following error:

“The DataSourceView is missing for the SemanticModel. SemanticModel must have exactly one DataSourceView element. (MissingDataSourceView).”

So you need to have the information about data source view inside your model file.

The report model file is an xml file containing information about the model in a language called ‘Semantic Model Definition Language’. Data source view file is also in xml format. You need to take the whole contents of the data source view (*.dsv) xml file and put it into the model file exactly after the ‘Entities’ node, ie, just before the closing tag of semantic model.

After that, you need to remove all the attributes of the node except the last one (xmlns=http://schemas.microsoft.com/analysisservices/2003/engine), and then add the xsi type attribute (xsi:type="RelationalDataSourceView").

Now you can safely upload this model file to the Report Server using Report Manager and then associate a data source to make it work.

All these steps can be done programmatically by using Reporting Services web service.

repService.CreateModel(destFileName, "/" + destFolderName, fileDefinition, arrProperty);

U might have to use CreateDataSource to attach a data source.

SameerCT at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 3

I am able to create both the model and the data source programmatically using the ReportService2005 web service but when I examine the model data source in the web site, the following error is displayed: "The shared data source reference is no longer valid". If I manually associate the model with the newly created data source, it works fine.

The <DataSourceID> is correct in the smdl file. What am I doing wrong? Why won't this work programmatically?

I am using SQL Server 2005 Workgroup Edition. Any help would be greatly appreciated.

rotr at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 4

Hi,

I am confused about the step of " copying the code from .dsv file and then pasting into the .smdl file". how can I avoid this manual step ?

Please let me know

Regards,

bala

Bala_SSRS at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 5
The way I'm copying the data source view code into the .smdl file is a simple string replacement:

model = model.Replace("</SemanticModel>", dsvText + "\n</SemanticModel>");

paulisme at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...
# 6
Once you upload the report model to the server, you must call the SetItemDataSources() web service to set the data source on your report model.
paulisme at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Reporting Services...

SQL Server

Site Classified