How to configure MS SQL Server Reporting Service connection in code dynamically

In the web.config there is MSReportingServer setting that points to the report server. In order to set it in the code dynamically you may override it in your 'ReportService.svc.cs' file like in the following code:

[AspNetCompatibilityRequirements(RequirementsMode = 
.Required)] public class ReportService : ReportServiceRemote { protected override string GetServiceUrl() { return "MYURL"; } protected override System.Net.ICredentials GetServiceCredentials() { return base.GetServiceCredentials(); } }

, where "MYURL" is the URL you want to set.

parameters credential credentials

Add Feedback