I have been researching all day I can't find a solution. I have tried to build a custom resolver to change the server name and port as a test. I have coded this class it returns null because I cannot determine how to return a ReportSource.
public class TexasProtaxCustomReportResolver : Telerik.Reporting.Services.Engine.IReportResolver
{
public Telerik.Reporting.ReportSource Resolve(string reportName)
{
var reportPacker = new ReportPackager();
using (var sourceStream = System.IO.File.OpenRead(reportName))
{
var report = (Telerik.Reporting.Report)reportPacker.UnpackageDocument(sourceStream);
var webServiceDataSource = (WebServiceDataSource)report.DataSource;
string url = webServiceDataSource.ServiceUrl;
url = url.ToLower().Replace("localhost:5001", "localhost:44384");
webServiceDataSource.ServiceUrl = url;
return null;
}
}
}
In the ReportsConttroller I have tried adding the resolver but it has an error:
public ReportsController(ConfigurationService configSvc)
{
this.reportsPath = Path.Combine(configSvc.Environment.WebRootPath, "Reports");
this.ReportServiceConfiguration = new ReportServiceConfiguration
{
ReportingEngineConfiguration = configSvc.Configuration,
HostAppId = "ReportsService",
Storage = new FileStorage(),
ReportResolver = new ReportTypeResolver()
.AddFallbackResolver(new ReportFileResolver(this.reportsPath))
.AddFallbackResolver(new TexasProtaxCustomReportResolver())
};
}
Any assistance would be appreciated.