I have some reporting services reports in 2005.
The use a shared data source in a rds file
Ideally I want them to use a connection string that is passed in from a configuration file, ideally via ASP.NETs ReportViewer control.
Is this possible?
I have some reporting services reports in 2005.
The use a shared data source in a rds file
Ideally I want them to use a connection string that is passed in from a configuration file, ideally via ASP.NETs ReportViewer control.
Is this possible?
Hi, you can do like this
DataSourceCredentials cred = new DataSourceCredentials(); cred.Name = 'credential_name'; cred.UserId = 'user_id'; cred.Password = 'password';
ReportViewer1.ServerReport.SetDataSourceCredential(new DataSourceCredentials[] { cred }); ReportViewer1.ServerReport.Refresh();
Best Regards, Iordan
You can set the connection string etc dynamically using expression based connection strings
See http://blogs.msdn.com/bwelcker/archive/2005/04/29/413343.aspx
which uses the the same technique as below
http://msdn.microsoft.com/en-us/library/ms156450.aspx (part about Expression-based Connection Strings)
BUT, this is a bit pants as it means you cant preview your reports in the designer.