Why have all the DataExtensions clasess become internal in 2008 ??
I'm trying to migrate from RS2005 to RS2008. For 2005, connection wrappers were created so that the connection string could come in as a 'logical name', and the actual connection string is looked up (by a call to some service), so the 'real' connection string is then passed to the Connection object. In 2005, this was pretty easy: just wrap a Microsoft.ReportingServices.DataExtensions classes (e.g. SqlConnectionWrapper) and/or inherit from ConnectionExtension class, and done with it. It is not a welcome surprise to find that PRACTICALLY ALL of Microsoft.ReportingServices.DataExtensions.* has become sealed internal. Who has done this? Why? Am I overlooking something evident here? Is there a different, simple way of accomplishing what I need? At the moment, I'm trying to grab some of the contents of that namespace, implement it myself, and then using it - but this is just duplicating Microsoft code, and I just can't believe that would be the purpose... Please, help me out - either by pointing me to an easier way, or worst case, by just confirming that all this public stuff now has become private and I just have to live with that.... Many thanks, Frederik
September 13th, 2010 1:41am

Hi Frederik! Did you found any solution for this? I saw any reply. I can confirm that these classes are internal and I simply don't understand why too. Anyway the ReportingServiceService executable is able to instantiate them even if they are internal. So I tried to do this with Reflection and it seems to work. This is NOT TESTED but the instance is created successfully. Hope this can help... using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Reflection; using Microsoft.ReportingServices.Interfaces; using Microsoft.ReportingServices.DataProcessing; namespace CustomReportingServicesExtensions { class CustomDataExtension : IDbConnectionExtension { IDbConnectionExtension _wrapper = null; public CustomDataExtension() { string path = @"C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer\bin"; Assembly assembly = Assembly.LoadFrom(System.IO.Path.Combine(path, "Microsoft.ReportingServices.DataExtensions.dll")); _wrapper = (IDbConnectionExtension)assembly.CreateInstance("Microsoft.ReportingServices.DataExtensions.SqlConnectionWrapper"); } #region IDbConnectionExtension Interface Implementation string IDbConnectionExtension.Impersonate { set { _wrapper.Impersonate = value; } } bool IDbConnectionExtension.IntegratedSecurity { get { return _wrapper.IntegratedSecurity; } set { _wrapper.IntegratedSecurity = value; } } string IDbConnectionExtension.Password { set { _wrapper.Password = value; } } string IDbConnectionExtension.UserName { set { _wrapper.UserName = value; } } IDbTransaction IDbConnection.BeginTransaction() { return _wrapper.BeginTransaction(); } void IDbConnection.Close() { _wrapper.Close(); } string IDbConnection.ConnectionString { get { return _wrapper.ConnectionString; } set { _wrapper.ConnectionString = value; } } int IDbConnection.ConnectionTimeout { get { return _wrapper.ConnectionTimeout; } } IDbCommand IDbConnection.CreateCommand() { return _wrapper.CreateCommand(); } void IDbConnection.Open() { _wrapper.Open(); } void IDisposable.Dispose() { _wrapper.Dispose(); } string IExtension.LocalizedName { get { return _wrapper.LocalizedName; } } void IExtension.SetConfiguration(string configuration) { _wrapper.SetConfiguration(configuration); } #endregion } } Regards Luigi
Free Windows Admin Tool Kit Click here and download it now
March 10th, 2011 4:51am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics