Pregunta

¿Es posible cambiar la cadena de conexión de un informe de servicios de informes de SQL publicado? Puedo ver el campo binario llamado DataSource en la base de datos ReportServer, pero como se almacena como binario, no creo que sea fácilmente actualizable.

¿Necesito volver a publicar el informe con la fuente de datos correcta? Espero que no, ya que no quiero tener que instalar VS2003.

EDITAR: el cliente está ejecutando SQL Server 2000 Reporting Services con todos los paquetes de servicio instalados.

¿Fue útil?

Solución

SQL Reporting Services 2000 tiene un [servicio web] ( http://msdn.microsoft.com/en-us/library/aa274396 (SQL.80) .aspx) que puede usar para cambiar la fuente de datos. Dado que, lo siguiente, permite cambiar una fuente de datos a una fuente de datos compartida. Esto fue [adaptado de MSDN] ( http: // msdn.microsoft.com/en-us/library/aa225896(SQL.80).aspx) .

// Create our reporting services class
ReportingService theRS = new ReportingService();
theRS.Credentials = System.Net.CredentialCache.DefaultCredentials;

// We need to setup a data source reference to an existing shared data source
DataSourceReference theDSRef = new DataSourceReference();
theDSRef.Reference = "/Path/To/ExistingSharedDataSource";
DataSource[] theDSArray = new DataSource[1];
DataSource theDS = new DataSource();
theDS.Item = (DataSourceReference)theDSRef;
theDS.Name = "NameOfSharedDataSource";
theDSArray[0] = theDS;

try
{
    // Attempt to change the data source of the report
    theRS.SetReportDataSources("/Path/To/ReportName", theDSArray);
    Console.Out.WriteLine("We have changed the data source");
}
catch (System.Web.Services.Protocols.SoapException e)
{
    Console.Out.WriteLine(e.Message);
    Console.Out.WriteLine(e.Detail.InnerXml.ToString());
}

En este ejemplo, la clase ReportingService se toma de la clase Proxy que generé para hablar con el servicio web, que se describe [aquí] ( http://msdn.microsoft.com/en-us/library/aa256607 (SQL.80) .aspx) .

Espero que esto ayude a algunos. Déjame saber si estás buscando algo diferente.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top