Thursday, March 22, 2012

Deployment of Reports and Data Sources

What is the best way to deploy reports to production considering the fact that different developers would be working on different reports and different data sources. Also consider that the data sources connect to local machines of the developers during report creation and a different database server on deployment.

One way is to use VS2005 to deploy it to production but I am not sure if that is the way to go?

Any ideas?

Thanks

I'd probably create an RSS script which will publish the report to the whatever server it needs to and then actually "fixes up" the report to point to a "production datasource" which already exists on the production box. This "production datasource" points to the correct database on the server.

Use the CreateReport() API to publish the report, and here's a quick sample on fixing up the datasource on a report:

DataSourceReference reference = new DataSourceReference();
DataSource[] dsarray = new DataSource[1];
DataSource ds = new DataSource();
reference.Reference = "/Data Sources/AdventureWorks";
ds.Item = (DataSourceReference)reference;
ds.Name = "AdventureWorks";
dsarray[0] = ds;
rs.SetItemDataSources("/AdventureWorks Sample Reports/Company Sales", dsarray)

It bascially sets the datasource of the Company Sales report to point to the AdventureWorks datasource int he /Data Sources folder.

The nice thing about this idea is that if you have only a few different databases to deal with, you could actually write the RSS script to that it acts on all reports in filesystem folder, and then does some thinking and points each report to the correct "production" data source during the "fix up" phase...

No comments:

Post a Comment