0

I am trying to use SSRS in a multi-tenant situation. The base version we want to support is SQL Server 2008 but if R2 is needed we might be ok with that.

I am currently using the ReportingService2005.asmx endpoint which seems to expose the ReportService2005SoapClient class (even though all samples seem to show ReportingService2005 class).

When we run a report I want to make a copy of that report from the server, add an embedded datasource, point the datasets to that datasource and then run the report.

I have gotten as far as:

  1. getting the RDL from the server

  2. modifying the XML to add the DataSource

  3. pointing the datasets to point to the new datasource

...but when I try to "CreateReport" I get the following error:

System.Web.Services.Protocols.SoapException: The dataset ‘DataSet1’ refers to the data source “mydatasource_LOCAL”, which does not exist.
at Microsoft.ReportingServices.Library.ReportingService2005Impl.ExecuteBatch(Guid batchId)
at Microsoft.ReportingServices.WebServer.ReportingService2005.ExecuteBatch()

I have added the dataset to the RDL, it looks the same as when I add one in the designer. However, I assume something needs to be added to the server? What am I missing?

(As an aside, I know MS Dynamics enabled multi-tennant SSRS in a single instance, but I see no info on how they did it. If they have any code or anything they share someone could point me to that would be awesome.)

Jeroen
  • 60,696
  • 40
  • 206
  • 339
PilotBob
  • 3,107
  • 7
  • 35
  • 52

1 Answers1

1

You're using the correct endpoint, more or less. From MSDN:

The ReportService2005 and ReportService2006 endpoints are deprecated in SQL Server 2008 R2. The ReportService2010 endpoint includes the functionalities of both endpoints and contains additional management features.

In any case, you mention you modify the RDL to use a new data source in step 2. I might be wrong, but I think you probably still need to add a DataSource item to your report catalog using the ReportingService2010 CreateDataSource(...) method.

If you deploy a new report from Visual Studio to report server it wil also mention in the log that it's deploying the data source before it deploys the report.

Of course you could also create that data source on the server beforehand, using the report manager (though "mydatasource_LOCAL" may not be an ideal name).

Jeroen
  • 60,696
  • 40
  • 206
  • 339
  • I don't see it deploy a datasource when I use an embedded datasource in the report, only when I create shared datasources. I will double check to be sure. (Yes, using that endpoint because we need to support SQL Server 2008 and higher). – PilotBob May 07 '13 at 21:25
  • It does appear when I deploy the report a datasource is created in the reportmanager db. It has an item ID that matches the report. But, how do I get the itemid of a report that I can't create inorder to do a createdatasource? – PilotBob May 08 '13 at 18:29
  • Seems I didn't have to even modify the RDL. Just clone the report and then use SetItemDataSources which created an embedded datasource for the report. – PilotBob May 08 '13 at 20:23